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

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 Feb 2026 13:23:58 -0800

SoutrikDas <[email-masked]> writes:

>> 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/[email-masked]/t/#m04cb1fc694f334cc861f6ab146f50b45ae277874
> [2] : https://lore.kernel.org/git/[email-masked]/
> ---
> 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...?