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

Re: [PATCH v2] cli: add -v and -h shorthands

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 31, 2022, 00:07 UTC
Message-ID
<220331.86tubfrngz.gmgdl@evledraar.gmail.com>
In-Reply-To
<fb915b91-ead2-ac35-4431-ad35674da463@slashdev.space>
On Thu, Mar 31 2022, Garrit Franke wrote:
Show 9 quoted lines
> On Wed, Mar 30 2022, Junio C Hamano wrote:
>
>> Sorry, but it is unclear why it is a good thing.
>
> My main motivation behind this change was a standardized user
> experience across tools. Many users use these shorthands out of habit
> to get an overview of a program. Seeing the command fail and having to
> retype it in a longer form creates unnecessary friction between the
> user and the program.

I think this is a good trade-off in this case. I.e. -v and -h are commonly understood.

Show 10 quoted lines
>> Again, it might be safe right now, but it also closes the door for
>> introducing global "verbose" option.  What in exchange are we
>> gaining?  Are these short options worth it?
>
> I definitely see your concerns. Ultimately it's a question of which of
> the two flags would be more convinient to have as a shorthand. As
> stated above, users unfamiliar to the software arguably expect to see
> the version number printed when using this flag. A user who seeks more 
> verbose output is probably more familiar with the options, so they are
> more likely to know they have to use the longer "--verbose" form.

This was somewhat discussed in/around https://lore.kernel.org/git/87zgs593ja.fsf@evledraar.gmail.com/, i.e. there I was arguing the counter-point, that we should have things like "git --no-progress subcmd <opts>", rather than just "git subcmd --no-progress <other-opts>".

But I think the alternative won the day (at least in that commit-graph case), and in retrospect I think it was the right call for our UI in general.

I still think it makes sense for git to understand a thing like --object-format at the top-level, and maybe/probably --progress, but --verbose is probably too confusing. I.e. it would imply verbose output for all commands (which they're much less likely to have/provide than the other two).

Previous: Garrit FrankeNext: Garrit Franke
Message 4 of 11 in “cli: add -v and -h shorthands”
  1. cli: add -v and -h shorthandsGarrit Franke, Mar 30, 2022
  2. Junio C HamanoMar 30, 2022
  3. Garrit FrankeMar 30, 2022
  4. Ævar Arnfjörð BjarmasonMar 31, 2022
  5. Garrit FrankeMar 31, 2022
  6. Junio C HamanoMar 31, 2022
  7. Ævar Arnfjörð BjarmasonApr 1, 2022
  8. Junio C HamanoApr 1, 2022
  9. Garrit FrankeApr 4, 2022
  10. Junio C HamanoApr 4, 2022
  11. cli: add -v and -h shorthandsGarrit Franke, Mar 31, 2022

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.