{"thread":{"id":"59649","subject":"Inconsistent names in `git shortlog`","startedAt":"2023-04-25T00:01:11Z","lastAt":"2023-04-25T15:46:13Z","messageCount":4,"participants":["Blyxyas","brian m. carlson","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"475995","messageId":"CAGeanHfxL9e_OHPFzBjLjgVU=QLvwYS9QVCGHC1JHSkApRAwgQ@mail.gmail.com","threadId":"59649","inReplyTo":null,"subject":"Inconsistent names in `git shortlog`","fromName":"Blyxyas","fromEmail":"blyxyas@gmail.com","sentAt":"2023-04-25T00:00:27Z","receivedAt":"2023-04-25T00:01:11Z","isPatch":false,"sender":{"key":"blyxyas@gmail.com","avatar":null},"body":"`git shortlog` (specifically talking about `git shortlog -sn`, but\napplies to the whole subcommand) produces a list of names based on the\ncontributors to a Git repository.\nBut it turns out that the output of the shortlog is very inconsistent\nin that sometimes it uses the username and other times the full name.\nThis can happen even in the same repo.\n\nThis isn't a big deal on its own, but there are some external tools\n(like thanks.rust-lang.org) that use the output of `git shortlog` to\nthank contributors, and it has some cases of people going just by\ntheir first name (no surnames), or people appearing multiple times,\nonce with their username and one with their real name.\n\nThere should be a convention established. I would personally prefer\nusing usernames, as the huge impact of Github would mean that it's\neasier to go to their profile just by copy-pasting their shortlog\nname. Maybe add a `--realname` / `-r` flag to the command to show the\nreal names and show usernames by default?\n"},{"id":"475997","messageId":"ZEchmO/7/KdLhsLg@tapette.crustytoothpaste.net","threadId":"59649","inReplyTo":"CAGeanHfxL9e_OHPFzBjLjgVU=QLvwYS9QVCGHC1JHSkApRAwgQ@mail.gmail.com","subject":"Re: Inconsistent names in `git shortlog`","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2023-04-25T00:40:56Z","receivedAt":"2023-04-25T00:41:03Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2023-04-25 at 00:00:27, Blyxyas wrote:\n> `git shortlog` (specifically talking about `git shortlog -sn`, but\n> applies to the whole subcommand) produces a list of names based on the\n> contributors to a Git repository.\n> But it turns out that the output of the shortlog is very inconsistent\n> in that sometimes it uses the username and other times the full name.\n> This can happen even in the same repo.\n\nI don't think `git shortlog` considers anything but what's in the author\nname field, as far as I can tell.  It may be that some people have\nplaced a username in that field, which is contrary to the intention that\nit be a personal name, but we can't force people to use a particular\nname.\n\ngit-commit(1) documents this:\n\n  The author and committer names are by convention some form of a\n  personal name (that is, the name by which other humans refer to you),\n  although Git does not enforce or require any particular form.\n  Arbitrary Unicode may be used, subject to the constraints listed above\n  [which I have elided here]. This name has no effect on authentication;\n  for that, see the credential.username variable in git-config(1).\n\nI added this documentation because many people _do_ think it has\nsomething to do with authentication and thus put a username there under\nthat mistaken impression.  I suspect that's what's happened in the\nsituation you mention.\n\n> There should be a convention established. I would personally prefer\n> using usernames, as the huge impact of Github would mean that it's\n> easier to go to their profile just by copy-pasting their shortlog\n> name. Maybe add a `--realname` / `-r` flag to the command to show the\n> real names and show usernames by default?\n\nThere are many Git users who don't use GitHub, and the documented\nintention is that it be a personal name, so I'd recommend that people\nuse that.  Regardless, we don't know what a person's GitHub username is\nor if they have one, and Git wouldn't want to prioritize one particular\nforge over another, so we wouldn't add any sort of API requests to\nGitHub in particular.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"476016","messageId":"20230425065242.GE4061254@coredump.intra.peff.net","threadId":"59649","inReplyTo":"CAGeanHfxL9e_OHPFzBjLjgVU=QLvwYS9QVCGHC1JHSkApRAwgQ@mail.gmail.com","subject":"Re: Inconsistent names in `git shortlog`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-04-25T06:52:42Z","receivedAt":"2023-04-25T06:52:49Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 25, 2023 at 02:00:27AM +0200, Blyxyas wrote:\n\n> This isn't a big deal on its own, but there are some external tools\n> (like thanks.rust-lang.org) that use the output of `git shortlog` to\n> thank contributors, and it has some cases of people going just by\n> their first name (no surnames), or people appearing multiple times,\n> once with their username and one with their real name.\n\nI agree with everything brian said elsewhere, but I wanted to add one\nthing: for this \"multiple times\" problem, it can be solved with a\nmailmap file, which associates names such that ones you don't like can\nbe rewritten to ones that you do. See \"git help mailmap\" for details and\nexamples.\n\n-Peff\n"},{"id":"476029","messageId":"xmqq8reg55j4.fsf@gitster.g","threadId":"59649","inReplyTo":"20230425065242.GE4061254@coredump.intra.peff.net","subject":"Re: Inconsistent names in `git shortlog`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-04-25T15:46:07Z","receivedAt":"2023-04-25T15:46:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Apr 25, 2023 at 02:00:27AM +0200, Blyxyas wrote:\n>\n>> This isn't a big deal on its own, but there are some external tools\n>> (like thanks.rust-lang.org) that use the output of `git shortlog` to\n>> thank contributors, and it has some cases of people going just by\n>> their first name (no surnames), or people appearing multiple times,\n>> once with their username and one with their real name.\n>\n> I agree with everything brian said elsewhere, but I wanted to add one\n> thing: for this \"multiple times\" problem, it can be solved with a\n> mailmap file, which associates names such that ones you don't like can\n> be rewritten to ones that you do. See \"git help mailmap\" for details and\n> examples.\n\nAnd another, potentially more effective, tool is to have a project\nconvention.  Teach the participant of your project to be consistent\nin the first place.\n\n"}]}