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

Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2026, 21:23 UTC
Message-ID
<xmqq5x7lg7ip.fsf@gitster.g>
In-Reply-To
<20260224204047.8452-1-valusoutrik@gmail.com>
SoutrikDas <valusoutrik@gmail.com> writes:
Show 28 quoted lines
>> After this review, I'm starting to think that leaving it empty by default
>> would be better. Specially after the review by Phillip Wood [2], who
>> has a good argument for it:
>> 
>> """
>>   As this is a plumbing command I think it would be clearer if the caller 
>>   was required to specify the output format and the information that they 
>>   require with an "--all" option for "show me everything" as Junio 
>>   suggested. If we were to set defaults for the format and keys now we 
>>   would be stuck with them forever.
>> """
>
> I don't really have much experience writing scripts, but ... if one is 
> scripting to get a certain value, would they not specify that ? like 
> why would they excecute a "git repo info" without any fields?
>
> Also ... mayeb this does not make much sense, but the
> 'git repo info --all' has only 4 fields now, so showing all 4, should be okay ?
> Or maybe not.
>
>
> [1] : https://public-inbox.org/git/20250610152117.14826-1-lucasseikioshiro@gmail.com/t/#m04cb1fc694f334cc861f6ab146f50b45ae277874
> [2] : https://lore.kernel.org/git/af27af92-73d5-4f0a-84f4-9c91de6ab6e6@gmail.com/
> ---
> Previously, git repo info would print nothing,
> when invoked without arguements. Change the default
> behaviour to display all available fields, to make
> it a little more user friendly.

The number of things do not matter. "user friendly" does not matter.

They do not matter plumbing commands intended to be used in scripts. What matters more is being predictable.

The silly example you saw in the discussion thread can be solved even if by default we showed everything. The UI can count the checkboxes it is going to turn into command's arguments (i.e., "I want to ask you about these pieces of information"), and if that is empty, just can refrain from invoking the command. But that is arguably _more_ work on the script. A simpler rule "we give only what you ask, always, no exceptions that depends on the number of things you ask (like when you ask for zero things)" would end up being easier to use.

And it is more predictable. If you ask for two things, you get two things. If you ask for one thing, you get one thing. If you ask for zero things? You get none.

So...?
Previous: SoutrikDasNext: SoutrikDas
Message 3 of 14 in “builtin/repo.c: change info default behavior to show all fields”
  1. builtin/repo.c: change info default behavior to show all fieldsSoutrikDas, Feb 24, 2026
  2. builtin/repo.c: change info default behavior to show all fieldsSoutrikDas, Feb 24, 2026
  3. Junio C HamanoFeb 24, 2026
  4. SoutrikDasFeb 24, 2026
  5. K JayatheerthFeb 25, 2026
  6. Junio C HamanoFeb 25, 2026
  7. SoutrikDasFeb 25, 2026
  8. Junio C HamanoFeb 25, 2026
  9. Kristoffer HaugsbakkFeb 25, 2026
  10. JAYATHEERTH KFeb 25, 2026
  11. Lucas Seiki OshiroFeb 25, 2026
  12. SoutrikDasFeb 25, 2026
  13. SoutrikDasFeb 25, 2026
  14. Lucas Seiki OshiroFeb 25, 2026

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.