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

Re: [RFC] Universal progress option (was Re: [PATCH] clone: use --quiet when stderr is not a terminal)

From
Derrick Stolee <stolee@gmail.com>
Date
Mar 16, 2020, 00:27 UTC
Message-ID
<db38c8ef-426b-ecbd-b8b4-de6faf8d3ff1@gmail.com>
In-Reply-To
<xmqq5zf59nkb.fsf@gitster.c.googlers.com>
On 3/15/2020 7:59 PM, Junio C Hamano wrote:
Show 28 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> If the parser that kicks in before the commands do their own parsing
>> needs to know that much to correctly understand "--progress" anyway,
>> wouldn't the same amount of effort would allow us to teach these
>> individual commands to understand "--progress" and pass it correctly
>> down to the underlying helpers?
>>
>> So, "git clone --no-progress" that lets checkout progress may be a
>> bug worth fixing, but I do not think a global switch is a good way
>> forward.
> 
> You can sort-of work it around by introducing "--[no-]progress" that
> is taken as an option to the "git" command, just like "--[no-]pager"
> is, to work around the issue above.  But I have a feeling that you
> did not like the resulting UI, which is totally backward incompatible
> and break users' existing scripts and habits.
> 
> The resulting UI built around "git --[no-]progress subcmd" may feel
> much nicer, and I suspect that it would be something we would have
> picked, if we had today's experience back when we started adding
> progress display to individual subcommands.
> 
> As long as a clear transition path can be drawn, I do not
> necessarily object to such a direction that (1) introduces the
> global level "git --[no-]progress $subcmd" option, and (2)
> deprecates and eventually removes the "--progress" option at the
> subcommand level.

I think a way to compromise is to create an OPT_PROGRESS() macro that starts as a weak wrapper around the current OPT_BOOL() that is used with most builtins manually adding --[no-]progress. Then, it can be updated to do a more advanced action upon seeing --progress or --no-progress to set GIT_PROGRESS as described.

This would allow builtins to easily integrate --[no-]progress into their command-line parsing without issues as you described.

Thanks, -Stolee

Previous: Junio C Hamano
Message 8 of 8 in “clone: use --quiet when stderr is not a terminal”
  1. clone: use --quiet when stderr is not a terminalDerrick Stolee via GitGitGadget, Mar 13, 2020
  2. Elijah NewrenMar 14, 2020
  3. Junio C HamanoMar 14, 2020
  4. Derrick StoleeMar 15, 2020
  5. [RFC] Universal progress option (was Re: [PATCH] clone: use --quiet when stderr is not a terminal)Derrick Stolee, Mar 15, 2020
  6. Junio C HamanoMar 15, 2020
  7. Junio C HamanoMar 15, 2020
  8. Derrick StoleeMar 16, 2020

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.