summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-01-13 17:39:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-14 17:25:28 (GMT)
commit49ff9a7a02266a1b96e2236bc8f8d95e4b9507dd (patch)
treed21218dfd8ac9127362170ab6ddf6feb7bc0db4c /t/t7501-commit.sh
parent361df5df77255321b2ca409d892b4c24b7b0441d (diff)
downloadgit-49ff9a7a02266a1b96e2236bc8f8d95e4b9507dd.zip
git-49ff9a7a02266a1b96e2236bc8f8d95e4b9507dd.tar.gz
git-49ff9a7a02266a1b96e2236bc8f8d95e4b9507dd.tar.bz2
commit: show interesting ident information in summary
There are a few cases of user identity information that we consider interesting: (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 <alexander@hamilton.com>' [master 3d226a7] federalist papers Author: Publius <alexander@hamilton.com> 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 <peff@c-71-185-130-222.hsd1.va.comcast.net> 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 you@example.com If the identity used for this commit is wrong, you can fix it with: git commit --amend --author='Your Name <you@example.com>' 1 files changed, 1 insertions(+), 0 deletions(-) for case (2). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index a603f6d..0166d35 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -117,7 +117,11 @@ test_expect_success \
test_expect_success \
"overriding author from command line" \
"echo 'gak' >file && \
- git commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
+ git commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a >output 2>&1"
+
+test_expect_success \
+ "commit --author output mentions author" \
+ "grep Rubber.Duck output"
test_expect_success PERL \
"interactive add" \