From 02b47cd77e4af40da95a74c90846965a2ea6999b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 2 Dec 2009 23:16:18 +0100 Subject: builtin-commit: add --date option This is like --author: allow a user to specify a given date without using the GIT_AUTHOR_DATE environment variable. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index a603f6d21a..a529701241 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -211,6 +211,21 @@ test_expect_success 'amend commit to fix author' ' ' +test_expect_success 'amend commit to fix date' ' + + test_tick && + newtick=$GIT_AUTHOR_DATE && + git reset --hard && + git cat-file -p HEAD | + sed -e "s/author.*/author $author $newtick/" \ + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && + git commit --amend --date="$newtick" && + git cat-file -p HEAD > current && + test_cmp expected current + +' + test_expect_success 'sign off (1)' ' echo 1 >positive && -- cgit v1.2.3 From 49ff9a7a02266a1b96e2236bc8f8d95e4b9507dd Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 13 Jan 2010 12:39:51 -0500 Subject: 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 ' [master 3d226a7] federalist papers Author: Publius 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 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 ' 1 files changed, 1 insertions(+), 0 deletions(-) for case (2). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index a603f6d21a..0166d35e51 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 ' -a" + git commit -m 'author' --author 'Rubber Duck ' -a >output 2>&1" + +test_expect_success \ + "commit --author output mentions author" \ + "grep Rubber.Duck output" test_expect_success PERL \ "interactive add" \ -- cgit v1.2.3