All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Cc: Phillip Wood <phillip.wood123@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Elijah Newren <newren@gmail.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH 3/4] read-tree: add --quiet
Date: Fri, 22 Mar 2019 17:18:44 +0000	[thread overview]
Message-ID: <04d888be-d66b-110a-b1e4-35ff4897fcab@iee.org> (raw)
In-Reply-To: <20190322093138.13765-4-pclouds@gmail.com>

On 22/03/2019 09:31, Nguyễn Thái Ngọc Duy wrote:
> read-tree is basically the front end of unpack-trees code and shoud

s/shoud/should/

Philip

> expose all of its functionality (unless it's designed for internal
> use). This "opts.quiet" (formerly "opts.gently") was added for
> builtin/checkout.c but there is no reason why other read-tree users
> won't find this useful.
>
> The test that is updated to run 'read-tree --quiet' was added because
> unpack-trees was accidentally not being quiet [1] in 6a143aa2b2
> (checkout -m: attempt merge when deletion of path was staged -
> 2014-08-12). Because checkout is the only "opts.quiet" user, there was
> no other way to test quiet behavior. But we can now test it directly.
>
> 6a143aa2b2 was manually reverted to verify that read-tree --quiet
> works correctly (i.e. test_must_be_empty fails).
>
> [1] the commit message there say "errors out instead of performing a
>      merge" but I'm pretty sure the "performing a merge" happens anyway
>      even before that commit. That line should say "errors out
>      _in addition to_ performing a merge"
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>   Documentation/git-read-tree.txt | 4 ++++
>   builtin/read-tree.c             | 1 +
>   t/t7201-co.sh                   | 3 +++
>   3 files changed, 8 insertions(+)
>
> diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
> index 5c70bc2878..1e81f9c4e6 100644
> --- a/Documentation/git-read-tree.txt
> +++ b/Documentation/git-read-tree.txt
> @@ -128,6 +128,10 @@ OPTIONS
>   	Instead of reading tree object(s) into the index, just empty
>   	it.
>   
> +-q::
> +--quiet::
> +	Quiet, suppress feedback messages.
> +
>   <tree-ish#>::
>   	The id of the tree object(s) to be read/merged.
>   
> diff --git a/builtin/read-tree.c b/builtin/read-tree.c
> index 9083dcfa28..5c9c082595 100644
> --- a/builtin/read-tree.c
> +++ b/builtin/read-tree.c
> @@ -154,6 +154,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
>   		{ OPTION_CALLBACK, 0, "recurse-submodules", NULL,
>   			    "checkout", "control recursive updating of submodules",
>   			    PARSE_OPT_OPTARG, option_parse_recurse_submodules_worktree_updater },
> +		OPT__QUIET(&opts.quiet, N_("suppress feedback messages")),
>   		OPT_END()
>   	};
>   
> diff --git a/t/t7201-co.sh b/t/t7201-co.sh
> index 72b9b375ba..f165582019 100755
> --- a/t/t7201-co.sh
> +++ b/t/t7201-co.sh
> @@ -223,6 +223,9 @@ test_expect_success 'switch to another branch while carrying a deletion' '
>   	test_must_fail git checkout simple 2>errs &&
>   	test_i18ngrep overwritten errs &&
>   
> +	test_must_fail git read-tree --quiet -m -u HEAD simple 2>errs &&
> +	test_must_be_empty errs &&
> +
>   	git checkout --merge simple 2>errs &&
>   	test_i18ngrep ! overwritten errs &&
>   	git ls-files -u &&

  reply	other threads:[~2019-03-22 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22  9:31 [PATCH 0/4] prevent 'checkout -m' from losing staged changes Nguyễn Thái Ngọc Duy
2019-03-22  9:31 ` [PATCH 1/4] unpack-trees: keep gently check inside add_rejected_path Nguyễn Thái Ngọc Duy
2019-03-22  9:31 ` [PATCH 2/4] unpack-trees: rename "gently" flag to "quiet" Nguyễn Thái Ngọc Duy
2019-03-22  9:31 ` [PATCH 3/4] read-tree: add --quiet Nguyễn Thái Ngọc Duy
2019-03-22 17:18   ` Philip Oakley [this message]
2019-03-22  9:31 ` [PATCH 4/4] checkout: prevent losing staged changes with --merge Nguyễn Thái Ngọc Duy
2019-03-25 16:07   ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04d888be-d66b-110a-b1e4-35ff4897fcab@iee.org \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=newren@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=phillip.wood123@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.