summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junio@kernel.org>2007-01-22 21:03:31 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-23 03:40:57 (GMT)
commit83e24dce148fd384cbfb01cf718ec32618f6d8b3 (patch)
tree9d2f9c908909babfd4909d2d9e408c922ccbd834 /git-commit.sh
parent5e207b4bf837f0ac4e76a925b1c5cb23326de492 (diff)
downloadgit-83e24dce148fd384cbfb01cf718ec32618f6d8b3.zip
git-83e24dce148fd384cbfb01cf718ec32618f6d8b3.tar.gz
git-83e24dce148fd384cbfb01cf718ec32618f6d8b3.tar.bz2
[PATCH] honor --author even with --amend, -C, and -c.
Earlier code discarded GIT_AUTHOR_DATE taken from the base commit when --author was specified. This was often wrong as that use is likely to fix the spelling of author's name. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/git-commit.sh b/git-commit.sh
index e23918c..6f4dcdb 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -462,15 +462,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
fi >>"$GIT_DIR"/COMMIT_EDITMSG
# Author
-if test '' != "$force_author"
-then
- GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
- GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
- test '' != "$GIT_AUTHOR_NAME" &&
- test '' != "$GIT_AUTHOR_EMAIL" ||
- die "malformed --author parameter"
- export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
-elif test '' != "$use_commit"
+if test '' != "$use_commit"
then
pick_author_script='
/^author /{
@@ -501,6 +493,15 @@ then
export GIT_AUTHOR_EMAIL
export GIT_AUTHOR_DATE
fi
+if test '' != "$force_author"
+then
+ GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
+ GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
+ test '' != "$GIT_AUTHOR_NAME" &&
+ test '' != "$GIT_AUTHOR_EMAIL" ||
+ die "malformed --author parameter"
+ export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
+fi
PARENTS="-p HEAD"
if test -z "$initial_commit"