aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-09-30 00:34:23 +0100
committerJunio C Hamano <gitster@pobox.com>2007-09-29 23:16:08 -0700
commit81ab1cb43a872fc527b26388bc7e781c816d723b (patch)
tree7783e1e06b25876f8b93b434bcae2ffbaa9c000b
parent6a6eb3d09fcbfae41978fb5223ae03e2d103968b (diff)
downloadgit-81ab1cb43a872fc527b26388bc7e781c816d723b.tar.gz
git-81ab1cb43a872fc527b26388bc7e781c816d723b.tar.xz
rebase -i: squash should retain the authorship of the _first_ commit
It was determined on the mailing list, that it makes more sense for a "squash" to keep the author of the first commit as the author for the result of the squash. Make it so. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/git-rebase.txt2
-rwxr-xr-xgit-rebase--interactive.sh2
-rwxr-xr-xt/t3404-rebase-interactive.sh2
3 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 61b1810db..dfb8a0da5 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -293,7 +293,7 @@ rebasing.
If you want to fold two or more commits into one, replace the command
"pick" with "squash" for the second and subsequent commit. If the
commits had different authors, it will attribute the squashed commit to
-the author of the last commit.
+the author of the first commit.
In both cases, or when a "pick" does not succeed (because of merge
errors), the loop will stop to let you fix things, and you can continue
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 2fa53fdae..653393d8c 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -261,9 +261,9 @@ do_next () {
esac
failed=f
+ author_script=$(get_author_ident_from_commit HEAD)
output git reset --soft HEAD^
pick_one -n $sha1 || failed=t
- author_script=$(get_author_ident_from_commit $sha1)
echo "$author_script" > "$DOTEST"/author-script
case $failed in
f)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 718c9c1fa..6c92d6119 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -180,7 +180,7 @@ test_expect_success 'squash' '
'
test_expect_success 'retain authorship when squashing' '
- git show HEAD | grep "^Author: Nitfol"
+ git show HEAD | grep "^Author: Twerp Snog"
'
test_expect_success 'preserve merges with -p' '