From: Yann Dirson <ydirson@altern.org>
To: git@vger.kernel.org
Cc: Yann Dirson <ydirson@altern.org>
Subject: [PATCH] rebase-autosquash: add testcase for fixup occuring before its fixed commit.
Date: Sat, 23 Oct 2010 15:33:33 +0200 [thread overview]
Message-ID: <1287840813-6454-1-git-send-email-ydirson@altern.org> (raw)
Can easily occur when one has started splitting a patch in two, and
subsequently wants to migrate more contents from the bottom patch to the
top one: extracting a fixup using an interactive rebase, committing it
between the two.
Currently, the generated instructions do add the "fixup" directive at the
correct place, but the "pick" is also left where it was, making the "fixup"
a noop.
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
t/t3415-rebase-autosquash.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index fd2184c..226394d 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -50,6 +50,31 @@ test_expect_success 'auto fixup (config)' '
test_must_fail test_auto_fixup final-fixup-config-false
'
+test_auto_fixup_reversed() {
+ git reset --hard base &&
+
+ echo 3 >file1 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "fixup! first" &&
+
+ echo 3 >file2 &&
+ git add -u &&
+ test_tick &&
+ git commit -m "first" &&
+
+ git tag $1 &&
+ test_tick &&
+ git rebase --autosquash -i base &&
+ git log --oneline base..HEAD >actual &&
+ test 1 = $(wc -l <actual) &&
+ git diff --exit-code $1
+}
+
+test_expect_failure 'auto reversed fixup (option)' '
+ test_auto_fixup_reversed final-revfixup-option
+'
+
test_auto_squash() {
git reset --hard base &&
echo 1 >file1 &&
--
1.7.2.3
reply other threads:[~2010-10-23 13:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1287840813-6454-1-git-send-email-ydirson@altern.org \
--to=ydirson@altern.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).