Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Blyxyas <blyxyas@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Inconsistent names in `git shortlog`
Date: Tue, 25 Apr 2023 00:40:56 +0000	[thread overview]
Message-ID: <ZEchmO/7/KdLhsLg@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <CAGeanHfxL9e_OHPFzBjLjgVU=QLvwYS9QVCGHC1JHSkApRAwgQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2170 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2023-04-25  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25  0:00 Inconsistent names in `git shortlog` Blyxyas
2023-04-25  0:40 ` brian m. carlson [this message]
2023-04-25  6:52 ` Jeff King
2023-04-25 15:46   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZEchmO/7/KdLhsLg@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=blyxyas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).