summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6956f85)
raw | patch | inline | side by side (parent: 6956f85)
author | Thomas Rast <trast@student.ethz.ch> | |
Fri, 12 Mar 2010 17:04:33 +0000 (18:04 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 13 Mar 2010 05:55:40 +0000 (21:55 -0800) |
Luckily, all the support already happens to be there.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/git-am.sh b/git-am.sh
index 1056e7db6bba15112022421e3b3f9e3bdb96919f..7644474bcabc191ef11ce6b885a62794ec730a9c 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
go_next
done
-if test -s "$dotest"/rewritten && test -x "$GIT_DIR"/hooks/post-rewrite; then
+if test -s "$dotest"/rewritten; then
+ git notes copy --for-rewrite=rebase < "$dotest"/rewritten
+ if test -x "$GIT_DIR"/hooks/post-rewrite; then
"$GIT_DIR"/hooks/post-rewrite rebase < "$dotest"/rewritten
+ fi
fi
git gc --auto
index d72f549f61258e81f9a1be305441402f276c35ab..f69c062def7c2402a236b3eb0c136933c5bf7aae 100755 (executable)
test ! -f "$DOTEST"/verbose ||
git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
} &&
+ {
+ git notes copy --for-rewrite=rebase < "$REWRITTEN_LIST" ||
+ true # we don't care if this copying failed
+ } &&
if test -x "$GIT_DIR"/hooks/post-rewrite &&
test -s "$REWRITTEN_LIST"; then
"$GIT_DIR"/hooks/post-rewrite rebase < "$REWRITTEN_LIST"
diff --git a/git-rebase.sh b/git-rebase.sh
index 417a1a95cda1b997b5d468692e958d73b0468339..3a26321faa0803ff9d41f68628a96c042899f816 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
finish_rb_merge () {
move_to_original_branch
+ git notes copy --for-rewrite=rebase < "$dotest"/rewritten
if test -x "$GIT_DIR"/hooks/post-rewrite &&
test -s "$dotest"/rewritten; then
"$GIT_DIR"/hooks/post-rewrite rebase < "$dotest"/rewritten
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 4e6a44b623c456dc85f9daa6c4b5b1f0789c93c5..cca284004dca93921094d40648f04931a320f169 100755 (executable)
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
git diff --exit-code file-with-cr:CR HEAD:CR
'
+test_expect_success 'rebase can copy notes' '
+ git config notes.rewrite.rebase true &&
+ git config notes.rewriteRef "refs/notes/*" &&
+ test_commit n1 &&
+ test_commit n2 &&
+ test_commit n3 &&
+ git notes add -m"a note" n3 &&
+ git rebase --onto n1 n2 &&
+ test "a note" = "$(git notes show HEAD)"
+'
+
+test_expect_success 'rebase -m can copy notes' '
+ git reset --hard n3 &&
+ git rebase -m --onto n1 n2 &&
+ test "a note" = "$(git notes show HEAD)"
+'
+
test_done
index 4e3513709eb121769f87501c1862c996184a6d05..19668c2c9206c5dfe63a5992bc7d011a9cdb4083 100755 (executable)
git show HEAD~2 | grep "C changed"
'
+test_expect_success 'rebase -i can copy notes' '
+ git config notes.rewrite.rebase true &&
+ git config notes.rewriteRef "refs/notes/*" &&
+ test_commit n1 &&
+ test_commit n2 &&
+ test_commit n3 &&
+ git notes add -m"a note" n3 &&
+ git rebase --onto n1 n2 &&
+ test "a note" = "$(git notes show HEAD)"
+'
+
+cat >expect <<EOF
+an earlier note
+a note
+EOF
+
+test_expect_success 'rebase -i can copy notes over a fixup' '
+ git reset --hard n3 &&
+ git notes add -m"an earlier note" n2 &&
+ GIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 fixup 2" git rebase -i n1 &&
+ git notes show > output &&
+ test_cmp expect output
+'
+
test_done