Re: Inconsistent names in `git shortlog`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-04-25 at 00:00:27, Blyxyas wrote:
> `git shortlog` (specifically talking about `git shortlog -sn`, but
> applies to the whole subcommand) produces a list of names based on the
> contributors to a Git repository.
> But it turns out that the output of the shortlog is very inconsistent
> in that sometimes it uses the username and other times the full name.
> This can happen even in the same repo.

I don't think `git shortlog` considers anything but what's in the author
name field, as far as I can tell.  It may be that some people have
placed a username in that field, which is contrary to the intention that
it be a personal name, but we can't force people to use a particular
name.

git-commit(1) documents this:

  The author and committer names are by convention some form of a
  personal name (that is, the name by which other humans refer to you),
  although Git does not enforce or require any particular form.
  Arbitrary Unicode may be used, subject to the constraints listed above
  [which I have elided here]. This name has no effect on authentication;
  for that, see the credential.username variable in git-config(1).

I added this documentation because many people _do_ think it has
something to do with authentication and thus put a username there under
that mistaken impression.  I suspect that's what's happened in the
situation you mention.

> There should be a convention established. I would personally prefer
> using usernames, as the huge impact of Github would mean that it's
> easier to go to their profile just by copy-pasting their shortlog
> name. Maybe add a `--realname` / `-r` flag to the command to show the
> real names and show usernames by default?

There are many Git users who don't use GitHub, and the documented
intention is that it be a personal name, so I'd recommend that people
use that.  Regardless, we don't know what a person's GitHub username is
or if they have one, and Git wouldn't want to prioritize one particular
forge over another, so we wouldn't add any sort of API requests to
GitHub in particular.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux