提交 81ab1cb4 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

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: NJohannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 6a6eb3d0
......@@ -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
......
......@@ -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)
......
......@@ -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' '
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册