Thread (25 messages) 25 messages, 2 authors, 2023-11-15

Re: [PATCH v4 3/4] rebase: test autosquash with and without -i

From: Phillip Wood <hidden>
Date: 2023-11-13 17:02:20

On 11/11/2023 13:27, Andy Koppe wrote:
Amend t3415-rebase-autosquash.sh to test the --autosquash option and
rebase.autoSquash config with and without -i.
Thanks for adding these tests. I'd be happy to see this squashed into 
the previous commit, though that is probably not worth a re-roll on its own.

Best Wishes

Phillip
quoted hunk ↗ jump to hunk
Signed-off-by: Andy Koppe <redacted>
---
  t/t3415-rebase-autosquash.sh | 38 ++++++++++++++++++++++++++----------
  1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index a364530d76..fcc40d6fe1 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -43,7 +43,7 @@ test_auto_fixup () {
  
  	git tag $1 &&
  	test_tick &&
-	git rebase $2 -i HEAD^^^ &&
+	git rebase $2 HEAD^^^ &&
  	git log --oneline >actual &&
  	if test -n "$no_squash"
  	then
@@ -61,15 +61,24 @@ test_auto_fixup () {
  }
  
  test_expect_success 'auto fixup (option)' '
-	test_auto_fixup final-fixup-option --autosquash
+	test_auto_fixup fixup-option --autosquash &&
+	test_auto_fixup fixup-option-i "--autosquash -i"
  '
  
-test_expect_success 'auto fixup (config)' '
+test_expect_success 'auto fixup (config true)' '
  	git config rebase.autosquash true &&
-	test_auto_fixup final-fixup-config-true &&
+	test_auto_fixup ! fixup-config-true &&
+	test_auto_fixup fixup-config-true-i -i &&
  	test_auto_fixup ! fixup-config-true-no --no-autosquash &&
+	test_auto_fixup ! fixup-config-true-i-no "-i --no-autosquash"
+'
+
+test_expect_success 'auto fixup (config false)' '
  	git config rebase.autosquash false &&
-	test_auto_fixup ! final-fixup-config-false
+	test_auto_fixup ! fixup-config-false &&
+	test_auto_fixup ! fixup-config-false-i -i &&
+	test_auto_fixup fixup-config-false-yes --autosquash &&
+	test_auto_fixup fixup-config-false-i-yes "-i --autosquash"
  '
  
  test_auto_squash () {
@@ -87,7 +96,7 @@ test_auto_squash () {
  	git commit -m "squash! first" -m "extra para for first" &&
  	git tag $1 &&
  	test_tick &&
-	git rebase $2 -i HEAD^^^ &&
+	git rebase $2 HEAD^^^ &&
  	git log --oneline >actual &&
  	if test -n "$no_squash"
  	then
@@ -105,15 +114,24 @@ test_auto_squash () {
  }
  
  test_expect_success 'auto squash (option)' '
-	test_auto_squash final-squash --autosquash
+	test_auto_squash squash-option --autosquash &&
+	test_auto_squash squash-option-i "--autosquash -i"
  '
  
-test_expect_success 'auto squash (config)' '
+test_expect_success 'auto squash (config true)' '
  	git config rebase.autosquash true &&
-	test_auto_squash final-squash-config-true &&
+	test_auto_squash ! squash-config-true &&
+	test_auto_squash squash-config-true-i -i &&
  	test_auto_squash ! squash-config-true-no --no-autosquash &&
+	test_auto_squash ! squash-config-true-i-no "-i --no-autosquash"
+'
+
+test_expect_success 'auto squash (config false)' '
  	git config rebase.autosquash false &&
-	test_auto_squash ! final-squash-config-false
+	test_auto_squash ! squash-config-false &&
+	test_auto_squash ! squash-config-false-i -i &&
+	test_auto_squash squash-config-false-yes --autosquash &&
+	test_auto_squash squash-config-false-i-yes "-i --autosquash"
  '
  
  test_expect_success 'misspelled auto squash' '
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help