On 2026-08-25 at 20:46:42, Andrew Pleeter via GitGitGadget wrote: > From: anpl1623 You will probably want this to match your real name since you're using it in the email. We prefer that people use their real names, but don't require it, but I assume that it's not a problem since you just CC'd yourself using it (and it's also in your email address). > Add a builtin 'whoami' command to inspect and display the resolved > author and committer identity along with the commit signing > configuration (GPG/SSH key ID and commit.gpgsign status) used when > creating Git commits. > > Support optional flags (--author, --committer, --name, --email, > --signing-key, and --verbose) for targeted querying and scripting. I suspect users will want a way to get _all_ of the output in a machine-readable way, so you'd probably want to provide some method of doing that. Note that because your existing endpoints provide translated strings, they are not suitable for this. That doesn't mean that they should not be translated (because they should) but we'd probably want a format like the following: user.author.name=A U Thor user.author.email=author@example.com Other formats are possible, though. Possibly a `-z` option for NUL-terminated instead of LF-terminated output might be warranted as well unless we're certain that our output will never contain a newline (hint: config options can). > Include documentation in Documentation/git-whoami.adoc and regression > tests in t/t0015-whoami.sh. > > Signed-off-by: anpl1623 Again, you'll want to sign this off with your real name. > MOTIVATION > > Users often work across multiple environments, profiles, or repositories > with different global/local configs and signing keys. Currently, > verifying what identity and signing key will be attached to a new commit > requires checking several individual git config and git var settings. > git whoami provides a simple, direct porcelain command to verify this in > one step. I think this should go in the commit message. I thought to myself, "Well, there are already ways to get this information, so why add a new one?" Telling us why your patch is compelling and solves an important purpose is appropriate for the commit message. I might also like to see an explanation as to why this wouldn't work better in `git var` or elsewhere instead, since much of the information is already there. Since that's an alternative you've rejected, tell us why and sell us on your vision. > + repo_config(the_repository, git_default_config, NULL); Let's not add more uses of `the_repository`. Use the `repo` argument to the main function above, taking care to handle the NULL case. > + repo_config_get_bool(the_repository, "commit.gpgsign", &gpgsign); > + repo_config_get_string(the_repository, "user.signingkey", &signing_key); > + repo_config_get_string(the_repository, "gpg.format", &gpg_format); > + repo_config_get_string(the_repository, "gpg.ssh.defaultkeycommand", &ssh_default_key_cmd); > + > + is_ssh = gpg_format && !strcmp(gpg_format, "ssh"); > + > + if (signing_key && *signing_key) { > + resolved_key = xstrdup(signing_key); > + } else if (is_ssh) { > + if (ssh_default_key_cmd && *ssh_default_key_cmd) > + resolved_key = get_signing_key_id(); > + } else if (gpgsign) { > + resolved_key = get_signing_key_id(); > + } Should this also do something useful for X.509 keys? Overall, I don't have a strong need for this and I'm fine using the existing functionality. However, I see how it could be useful and if it were merged and available in the versions of Git I use, then I might make use of it. Perhaps others think this is compelling, though, so I'm interested to hear other opinions about the utility of the command. -- brian m. carlson (they/them) Toronto, Ontario, CA