git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] worktree: add --quiet option

From
Elia Pinto <gitter.spiros@gmail.com>
Date
Aug 7, 2018, 15:46 UTC
Message-ID
<CA+EOSBmA_147s=ON3UMiQ=aN_7uy2TYQvcsU-qOnF9UtiyyiQQ@mail.gmail.com>
In-Reply-To
<CAN0heSrsHNnZoMFF+v+Fc_Ketk3fnQsnM=BuYVwkT5DPRjHsLw@mail.gmail.com>
2018-08-07 16:37 GMT+02:00 Martin Ågren <martin.agren@gmail.com>:
Show 66 quoted lines
> Hi Elia
>
> On 7 August 2018 at 15:21, Elia Pinto <gitter.spiros@gmail.com> wrote:
>> Add the '--quiet' option to git worktree add,
>> as for the other git commands.
>>
>> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
>> ---
>>  Documentation/git-worktree.txt |  4 +++-
>>  builtin/worktree.c             | 11 +++++++++--
>>  2 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
>> index 9c26be40f..508cde55c 100644
>> --- a/Documentation/git-worktree.txt
>> +++ b/Documentation/git-worktree.txt
>> @@ -115,7 +115,9 @@ Unlock a working tree, allowing it to be pruned, moved or deleted.
>>
>>  OPTIONS
>>  -------
>> -
>
> Grepping through Documentation/, it is clear that we sometimes have a
> blank line here, sometimes not. I'm not sure what to make of that.
>
>> +-q::
>> +--quiet::
>> +       With 'add', suppress feedback messages.
>>  -f::
>
> But I do think that for consistency, we'd prefer a blank line before `-f::`.
>
> Both the commit message and this documentation makes me wonder if this
> focuses on "add" because it's the only subcommand where `--quiet` makes
> sense, conceptually, or because this is where you happen to need it
> personally, or due to some other $reason. Could you say something more
> about this?
>
> I'm not a worktree power-user, so please forgive my ignorance...
>
>> @@ -315,6 +316,9 @@ static int add_worktree(const char *path, const char *refname,
>>                 cp.argv = NULL;
>>                 argv_array_clear(&cp.args);
>>                 argv_array_pushl(&cp.args, "reset", "--hard", NULL);
>> +               if (opts->quiet)
>> +                       argv_array_push(&cp.args, "--quiet");
>> +               printf("%s\n","soo qia");
>
> This last line looks like debug cruft.
>
>> @@ -437,6 +441,7 @@ static int add(int ac, const char **av, const char *prefix)
>>                 OPT_BOOL(0, "detach", &opts.detach, N_("detach HEAD at named commit")),
>>                 OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
>>                 OPT_BOOL(0, "lock", &opts.keep_locked, N_("keep the new working tree locked")),
>> +               OPT__QUIET(&opts.quiet, N_("suppress progress reporting")),
>
> This matches other users. Good.
>
> I did some simple testing and this appears to be quite quiet, modulo
> the "soo qia" that I already mentioned. Could you add a test to
> demonstrate the quietness and to keep it from regressing? Something like
> `git worktree add ../foo >out && test_must_be_empty out" in e.g.,
> t2025-worktree-add.sh might do the trick (capture stderr as well?).
>
> Hope this helps
> Martin
Thank you all. sorry for the trash in the patch I will resend it.
Previous: Martin ÅgrenNext: Duy Nguyen
Message 3 of 5 in “worktree: add --quiet option”
  1. worktree: add --quiet optionElia Pinto, Aug 7, 2018
  2. Martin ÅgrenAug 7, 2018
  3. Elia PintoAug 7, 2018
  4. Duy NguyenAug 7, 2018
  5. Eric SunshineAug 7, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.