Re: [PATCH v4 2/2] repo: add --all to git-repo-info
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 19, 2025, 07:32 UTC
- Message-ID
- <CAPig+cSMOEWUZPfLQJBWpAgK-cvAUMgD1t2KsVVAMWn30ngwiw@mail.gmail.com>
- In-Reply-To
- <xmqqh5usiizp.fsf@gitster.g>
On Mon, Nov 17, 2025 at 1:58 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
> > + if (all_keys) {
> > + if (argc)
> > + die(_("--all and <key> cannot be used together"));
> > +
> > + print_all_fields(repo, format);
> > + return 0;
> > + }
> > return print_fields(argc, argv, repo, format);
>
> This would work, but the symmetry between a list of keys vs the
> "--all" option is lost.
>
> I'd rather see something like the following after a #leftoverbits
> clean-up commit:
>
> if (all_keys && argc)
> die(_("--all and <key> cannot be used together"));
>
> if (all_keys)
> return print_all_fields(repo, format);
> else
> return print_fields(argc, argv, repo, format);For what it's worth, I had the same reaction when reviewing the previous version, and thought about proposing the same rewrite but figured that such a comment might fall into the "too subjective" category, thus omitted it from my review.