public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: SoutrikDas <valusoutrik@gmail.com>
Cc: git@vger.kernel.org,  karthik.188@gmail.com,  jltobler@gmail.com,
	ayu.chandekar@gmail.com,  siddharthasthana31@gmail.com,
	lucasseikioshiro@gmail.com
Subject: Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields
Date: Tue, 24 Feb 2026 13:23:58 -0800	[thread overview]
Message-ID: <xmqq5x7lg7ip.fsf@gitster.g> (raw)
In-Reply-To: <20260224204047.8452-1-valusoutrik@gmail.com> (SoutrikDas's message of "Wed, 25 Feb 2026 02:10:47 +0530")

SoutrikDas <valusoutrik@gmail.com> 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/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...?

  parent reply	other threads:[~2026-02-24 21:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 20:40 [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields SoutrikDas
2026-02-24 21:03 ` [PATCH v2] " SoutrikDas
2026-02-24 21:23 ` Junio C Hamano [this message]
2026-02-24 22:08   ` [RFC RFC PATCH] " SoutrikDas
2026-02-25  0:14     ` K Jayatheerth
2026-02-25  2:44       ` Junio C Hamano
2026-02-25 15:34         ` SoutrikDas
2026-02-25 15:46           ` Junio C Hamano
2026-02-25 15:48           ` Kristoffer Haugsbakk
2026-02-25 17:02           ` JAYATHEERTH K
2026-02-25 15:11       ` Lucas Seiki Oshiro
2026-02-25 15:38         ` SoutrikDas
2026-02-25 15:31       ` SoutrikDas
2026-02-25 16:08         ` Lucas Seiki Oshiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq5x7lg7ip.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ayu.chandekar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=karthik.188@gmail.com \
    --cc=lucasseikioshiro@gmail.com \
    --cc=siddharthasthana31@gmail.com \
    --cc=valusoutrik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox