git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Testcase for a rebase-autosquash bug
@ 2010-10-01 21:19 Yann Dirson
  2010-10-01 21:19 ` [PATCH 1/2] t/t3415: use && where applicable Yann Dirson
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Dirson @ 2010-10-01 21:19 UTC (permalink / raw)
  To: git; +Cc: Yann Dirson

While using --autosquash with a "fixup" commit intended to fixup one
of its descendants, I noticed it just did not work, so here is a
testcase for the failure.

While I was at it, it looked to me like a couple of "&&" were missing.
We surely want commit failures to fail at those places - although
failures there would probably induce failures later on which would be
detected, it is always better to fail early.

Yann Dirson (2):
  t/t3415: use && where applicable.
  rebase-autosquash: add testcase for fixup occuring before its fixed
    commit.

 t/t3415-rebase-autosquash.sh |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

-- 
1.7.2.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] t/t3415: use && where applicable.
  2010-10-01 21:19 [PATCH 0/2] Testcase for a rebase-autosquash bug Yann Dirson
@ 2010-10-01 21:19 ` Yann Dirson
  2010-10-01 21:19   ` [PATCH 2/2] rebase-autosquash: add testcase for fixup occuring before its fixed commit Yann Dirson
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Dirson @ 2010-10-01 21:19 UTC (permalink / raw)
  To: git; +Cc: Yann Dirson

Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 t/t3415-rebase-autosquash.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 37cb89a..fd2184c 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -26,7 +26,7 @@ test_auto_fixup() {
 	echo 1 >file1 &&
 	git add -u &&
 	test_tick &&
-	git commit -m "fixup! first"
+	git commit -m "fixup! first" &&
 
 	git tag $1 &&
 	test_tick &&
@@ -55,7 +55,7 @@ test_auto_squash() {
 	echo 1 >file1 &&
 	git add -u &&
 	test_tick &&
-	git commit -m "squash! first"
+	git commit -m "squash! first" &&
 
 	git tag $1 &&
 	test_tick &&
@@ -84,7 +84,7 @@ test_expect_success 'misspelled auto squash' '
 	echo 1 >file1 &&
 	git add -u &&
 	test_tick &&
-	git commit -m "squash! forst"
+	git commit -m "squash! forst" &&
 	git tag final-missquash &&
 	test_tick &&
 	git rebase --autosquash -i HEAD^^^ &&
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] rebase-autosquash: add testcase for fixup occuring before its fixed commit.
  2010-10-01 21:19 ` [PATCH 1/2] t/t3415: use && where applicable Yann Dirson
@ 2010-10-01 21:19   ` Yann Dirson
  0 siblings, 0 replies; 3+ messages in thread
From: Yann Dirson @ 2010-10-01 21:19 UTC (permalink / raw)
  To: git; +Cc: Yann Dirson

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-01 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 21:19 [PATCH 0/2] Testcase for a rebase-autosquash bug Yann Dirson
2010-10-01 21:19 ` [PATCH 1/2] t/t3415: use && where applicable Yann Dirson
2010-10-01 21:19   ` [PATCH 2/2] rebase-autosquash: add testcase for fixup occuring before its fixed commit Yann Dirson

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).