git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v1 2/2] t3432: test `--merge' with `rebase.abbreviateCommands = true', too

From
Alban Gruin <alban.gruin@gmail.com>
Date
Mar 30, 2020, 12:42 UTC
Message-ID
<20200330124236.6716-3-alban.gruin@gmail.com>
In-Reply-To
<20200330124236.6716-1-alban.gruin@gmail.com>

When fast forwarding, `git --merge' should act the same whether `rebase.abbreviateCommands' is set or not, but so far it was not the case. This duplicates the tests ensuring that `--merge' works when fast forwarding to check if it also works with abbreviated commands.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
---
 t/t3432-rebase-fast-forward.sh | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 6c9d4a1375..6f0452c0ea 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -28,10 +28,12 @@ test_rebase_same_head () {
 	shift &&
 	cmp_f="$1" &&
 	shift &&
-	test_rebase_same_head_ $status_n $what_n $cmp_n " --apply" "$*" &&
-	test_rebase_same_head_ $status_f $what_f $cmp_f " --apply --no-ff" "$*"
-	test_rebase_same_head_ $status_n $what_n $cmp_n " --merge" "$*" &&
-	test_rebase_same_head_ $status_f $what_f $cmp_f " --merge --no-ff" "$*"
+	test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --apply" "$*" &&
+	test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --apply --no-ff" "$*"
+	test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --merge" "$*" &&
+	test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --merge --no-ff" "$*"
+	test_rebase_same_head_ $status_n $what_n $cmp_n 1 " --merge" "$*" &&
+	test_rebase_same_head_ $status_f $what_f $cmp_f 1 " --merge --no-ff" "$*"
 }
 
 test_rebase_same_head_ () {
@@ -41,9 +43,21 @@ test_rebase_same_head_ () {
 	shift &&
 	cmp="$1" &&
 	shift &&
+	abbreviate="$1" &&
+	shift &&
 	flag="$1"
 	shift &&
-	test_expect_$status "git rebase$flag $* with $changes is $what with $cmp HEAD" "
+	if test $abbreviate -eq 1
+	then
+		msg="git rebase$flag $* (rebase.abbreviateCommands = true) with $changes is $what with $cmp HEAD"
+	else
+		msg="git rebase$flag $* with $changes is $what with $cmp HEAD"
+	fi &&
+	test_expect_$status "$msg" "
+		if test $abbreviate -eq 1
+		then
+			test_config rebase.abbreviateCommands true
+		fi &&
 		oldhead=\$(git rev-parse HEAD) &&
 		test_when_finished 'git reset --hard \$oldhead' &&
 		cp .git/logs/HEAD expect &&
-- 
2.25.0
Previous: Eric Sunshine
Message 11 of 11 in “git rebase fast-forward fails with abbreviateCommands”
  1. Jan Alexander Steffens (heftig)Mar 27, 2020
  2. Alban GruinMar 27, 2020
  3. Elijah NewrenMar 27, 2020
  4. Jan Alexander Steffens (heftig)Mar 27, 2020
  5. Alban GruinMar 28, 2020
  6. Junio C HamanoMar 27, 2020
  7. 0/2 rebase --merge: fix fast forwarding when `rebase.abbreviateCommands' is setAlban Gruin, Mar 30, 2020
  8. 1/2 sequencer: don't abbreviate a command if it doesn't have a short formAlban Gruin, Mar 30, 2020
  9. Junio C HamanoMar 30, 2020
  10. Eric SunshineMar 30, 2020
  11. 2/2 t3432: test `--merge' with `rebase.abbreviateCommands = true', tooAlban Gruin, Mar 30, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.