• Jeff King's avatar
    commit: show interesting ident information in summary · 49ff9a7a
    Jeff King authored
    There are a few cases of user identity information that we consider
      (1) When the author and committer identities do not match.
      (2) When the committer identity was picked automatically from the
          username, hostname and GECOS information.
    In these cases, we already show the information in the commit
    message template. However, users do not always see that template
    because they might use "-m" or "-F". With this patch, we show these
    interesting cases after the commit, along with the subject and
    change summary. The new output looks like:
      $ git commit \
          -m "federalist papers" \
          --author='Publius <[email protected]>'
      [master 3d226a7] federalist papers
       Author: Publius <[email protected]>
       1 files changed, 1 insertions(+), 0 deletions(-)
    for case (1), and:
      $ git config --global --unset user.name
      $ git config --global --unset user.email
      $ git commit -m foo
      [master 7c2a927] foo
       Committer: Jeff King <[email protected]>
      Your name and email address were configured automatically based
      on your username and hostname. Please check that they are accurate.
      You can suppress this message by setting them explicitly:
          git config --global user.name Your Name
          git config --global user.email [email protected]
      If the identity used for this commit is wrong, you can fix it with:
          git commit --amend --author='Your Name <[email protected]>'
       1 files changed, 1 insertions(+), 0 deletions(-)
    for case (2).
    Signed-off-by: default avatarJeff King <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
t7501-commit.sh 9.11 KB