From: Junio C Hamano Date: Tue, 25 Aug 2026 21:41:43 GMT Subject: Re: [PATCH] builtin/whoami: add new 'whoami' command Message-ID: In-Reply-To: "Andrew Pleeter via GitGitGadget" writes: > builtin/whoami: add new 'whoami' command In general, I would really really want to see us refrain from adding any more random subcommands. > +`-a`:: > +`--author`:: > + Show author identity. > + > +`-c`:: > +`--committer`:: > + Show committer identity. This pair hints the users they are equals. But the code tells us otherwise: > + if (show_name) { > + if (show_author) > + puts(author_name.buf); > + else > + puts(committer_name.buf); > + goto cleanup; > + } > + So when "-n" is in effect, "-c" is completely ignored. Lack of "-a" means "-c" instead. The same story holds for "-e". Yet later in the code that is executed when neither "-n" or "-e" is in effect: > + if (show_author) { > + puts(author_info.buf); > + goto cleanup; > + } > + > + if (show_committer) { > + puts(committer_info.buf); > + goto cleanup; > + } > + Here, lack of "-a" is not sufficient to view committer information and you'd explicitly need to pass "-c" if you want to view committer information. So confusing. > +`-n`:: > +`--name`:: > + Show name only. > + > +`-e`:: > +`--email`:: > + Show email only. Why not make -a/-c/-n/-e more additive instead? Something along the lines of ... $ git ident -a -e -n Andrew Pleeter $ git ident -a -n -v Author: Andrew Pleeter $ git ident -a -c -e $ git ident -a -c -e -v Author: Committer: