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

[PATCH 1/3] t3650: use option with value consistenly with equal sign

From
Toon Claes <toon@iotcl.com>
Date
Mar 23, 2026, 16:09 UTC
Message-ID
<20260323-toon-replay-arbitrary-ref-v1-1-5c7172f675ec@iotcl.com>
In-Reply-To
<20260323-toon-replay-arbitrary-ref-v1-0-5c7172f675ec@iotcl.com>

The tests in t3650-replay-basics have mixed use of option arguments with value with and without equal sign. Bring in consistency and use equal sign for all options that expect a value. This makes it easier to distinguish them from positional arguments.

Signed-off-by: Toon Claes <toon@iotcl.com>
---
 t/t3650-replay-basics.sh | 70 ++++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/t/t3650-replay-basics.sh b/t/t3650-replay-basics.sh
index 0c1e03e0fb..47811b3197 100755
--- a/t/t3650-replay-basics.sh
+++ b/t/t3650-replay-basics.sh
@@ -95,8 +95,8 @@ test_expect_success '--contained requires --onto' '
 '
 
 test_expect_success 'cannot advance target ... ordering would be ill-defined' '
-	cat >expect <<-\EOF &&
-	fatal: '"'"'--advance'"'"' cannot be used with multiple revision ranges because the ordering would be ill-defined
+	cat >expect <<-EOF &&
+	fatal: ${SQ}--advance${SQ} cannot be used with multiple revision ranges because the ordering would be ill-defined
 	EOF
 	test_must_fail git replay --advance=main main topic1 topic2 2>actual &&
 	test_cmp expect actual
@@ -109,7 +109,7 @@ test_expect_success 'replaying merge commits is not supported yet' '
 '
 
 test_expect_success 'using replay to rebase two branches, one on top of other' '
-	git replay --ref-action=print --onto main topic1..topic2 >result &&
+	git replay --ref-action=print --onto=main topic1..topic2 >result &&
 
 	test_line_count = 1 result &&
 
@@ -125,16 +125,16 @@ test_expect_success 'using replay to rebase two branches, one on top of other' '
 '
 
 test_expect_success 'using replay on bare repo to rebase two branches, one on top of other' '
-	git -C bare replay --ref-action=print --onto main topic1..topic2 >result-bare &&
+	git -C bare replay --ref-action=print --onto=main topic1..topic2 >result-bare &&
 	test_cmp expect result-bare
 '
 
 test_expect_success 'using replay to rebase with a conflict' '
-	test_expect_code 1 git replay --onto topic1 B..conflict
+	test_expect_code 1 git replay --onto=topic1 B..conflict
 '
 
 test_expect_success 'using replay on bare repo to rebase with a conflict' '
-	test_expect_code 1 git -C bare replay --onto topic1 B..conflict
+	test_expect_code 1 git -C bare replay --onto=topic1 B..conflict
 '
 
 test_expect_success 'using replay to perform basic cherry-pick' '
@@ -143,7 +143,7 @@ test_expect_success 'using replay to perform basic cherry-pick' '
 	# 2nd field of result is refs/heads/main vs. refs/heads/topic2
 	# 4th field of result is hash for main instead of hash for topic2
 
-	git replay --ref-action=print --advance main topic1..topic2 >result &&
+	git replay --ref-action=print --advance=main topic1..topic2 >result &&
 
 	test_line_count = 1 result &&
 
@@ -159,7 +159,7 @@ test_expect_success 'using replay to perform basic cherry-pick' '
 '
 
 test_expect_success 'using replay on bare repo to perform basic cherry-pick' '
-	git -C bare replay --ref-action=print --advance main topic1..topic2 >result-bare &&
+	git -C bare replay --ref-action=print --advance=main topic1..topic2 >result-bare &&
 	test_cmp expect result-bare
 '
 
@@ -170,11 +170,11 @@ test_expect_success 'commits that become empty are dropped' '
 	test_when_finished "git update-ref --stdin <original-branches &&
 		rm original-branches" &&
 	# Cherry-pick tip of topic1 ("F"), from the middle of A..empty, to main
-	git replay --advance main topic1^! &&
+	git replay --advance=main topic1^! &&
 
 	# Replay all of A..empty onto main (which includes topic1 & thus F
 	# in the middle)
-	git replay --onto main --branches --ancestry-path=empty ^A \
+	git replay --onto=main --branches --ancestry-path=empty ^A \
 		>result &&
 	git log --format="%s%d" L..empty >actual &&
 	test_write_lines >expect \
@@ -183,7 +183,7 @@ test_expect_success 'commits that become empty are dropped' '
 '
 
 test_expect_success 'replay on bare repo fails with both --advance and --onto' '
-	test_must_fail git -C bare replay --advance main --onto main topic1..topic2 >result-bare
+	test_must_fail git -C bare replay --advance=main --onto=main topic1..topic2 >result-bare
 '
 
 test_expect_success 'replay fails when both --advance and --onto are omitted' '
@@ -191,7 +191,7 @@ test_expect_success 'replay fails when both --advance and --onto are omitted' '
 '
 
 test_expect_success 'using replay to also rebase a contained branch' '
-	git replay --ref-action=print --contained --onto main main..topic3 >result &&
+	git replay --ref-action=print --contained --onto=main main..topic3 >result &&
 
 	test_line_count = 2 result &&
 	cut -f 3 -d " " result >new-branch-tips &&
@@ -215,12 +215,12 @@ test_expect_success 'using replay to also rebase a contained branch' '
 '
 
 test_expect_success 'using replay on bare repo to also rebase a contained branch' '
-	git -C bare replay --ref-action=print --contained --onto main main..topic3 >result-bare &&
+	git -C bare replay --ref-action=print --contained --onto=main main..topic3 >result-bare &&
 	test_cmp expect result-bare
 '
 
 test_expect_success 'using replay to rebase multiple divergent branches' '
-	git replay --ref-action=print --onto main ^topic1 topic2 topic4 >result &&
+	git replay --ref-action=print --onto=main ^topic1 topic2 topic4 >result &&
 
 	test_line_count = 2 result &&
 	cut -f 3 -d " " result >new-branch-tips &&
@@ -244,7 +244,7 @@ test_expect_success 'using replay to rebase multiple divergent branches' '
 '
 
 test_expect_success 'using replay on bare repo to rebase multiple divergent branches, including contained ones' '
-	git -C bare replay --ref-action=print --contained --onto main ^main topic2 topic3 topic4 >result &&
+	git -C bare replay --ref-action=print --contained --onto=main ^main topic2 topic3 topic4 >result &&
 
 	test_line_count = 4 result &&
 	cut -f 3 -d " " result >new-branch-tips &&
@@ -276,7 +276,7 @@ test_expect_success 'using replay to update detached HEAD' '
 	test_when_finished git switch "$current_head" &&
 	git switch --detach &&
 	test_commit something &&
-	git replay --ref-action=print --onto HEAD~2 --ref-action=print HEAD~..HEAD >updates &&
+	git replay --ref-action=print --onto=HEAD~2 --ref-action=print HEAD~..HEAD >updates &&
 	test_grep "update HEAD " updates
 '
 
@@ -299,7 +299,7 @@ test_expect_success 'merge.directoryRenames=false' '
 	git commit -m modified to-rename/add-a-file.t &&
 
 	git -c merge.directoryRenames=false replay \
-		--onto rename-onto rename-onto..rename-from
+		--onto=rename-onto rename-onto..rename-from
 '
 
 test_expect_success 'default atomic behavior updates refs directly' '
@@ -308,7 +308,7 @@ test_expect_success 'default atomic behavior updates refs directly' '
 	test_when_finished "git branch -D test-atomic" &&
 
 	# Test default atomic behavior (no output, refs updated)
-	git replay --onto main topic1..test-atomic >output &&
+	git replay --onto=main topic1..test-atomic >output &&
 	test_must_be_empty output &&
 
 	# Verify ref was updated
@@ -329,7 +329,7 @@ test_expect_success 'atomic behavior in bare repository' '
 	test_when_finished "git -C bare update-ref refs/heads/topic2 $START" &&
 
 	# Test atomic updates work in bare repo
-	git -C bare replay --onto main topic1..topic2 >output &&
+	git -C bare replay --onto=main topic1..topic2 >output &&
 	test_must_be_empty output &&
 
 	# Verify ref was updated in bare repo
@@ -344,7 +344,7 @@ test_expect_success 'reflog message for --advance mode' '
 	test_when_finished "git update-ref refs/heads/main $START" &&
 
 	# Test --advance mode reflog message
-	git replay --advance main topic1..topic2 >output &&
+	git replay --advance=main topic1..topic2 >output &&
 	test_must_be_empty output &&
 
 	# Verify reflog message includes --advance and branch name
@@ -360,7 +360,7 @@ test_expect_success 'replay.refAction=print config option' '
 
 	# Test with config set to print
 	test_config replay.refAction print &&
-	git replay --onto main topic1..topic2 >output &&
+	git replay --onto=main topic1..topic2 >output &&
 	test_line_count = 1 output &&
 	test_grep "^update refs/heads/topic2 " output
 '
@@ -372,7 +372,7 @@ test_expect_success 'replay.refAction=update config option' '
 
 	# Test with config set to update
 	test_config replay.refAction update &&
-	git replay --onto main topic1..topic2 >output &&
+	git replay --onto=main topic1..topic2 >output &&
 	test_must_be_empty output &&
 
 	# Verify ref was updated
@@ -388,14 +388,14 @@ test_expect_success 'command-line --ref-action overrides config' '
 
 	# Set config to update but use --ref-action=print
 	test_config replay.refAction update &&
-	git replay --ref-action=print --onto main topic1..topic2 >output &&
+	git replay --ref-action=print --onto=main topic1..topic2 >output &&
 	test_line_count = 1 output &&
 	test_grep "^update refs/heads/topic2 " output
 '
 
 test_expect_success 'invalid replay.refAction value' '
 	test_config replay.refAction invalid &&
-	test_must_fail git replay --onto main topic1..topic2 2>error &&
+	test_must_fail git replay --onto=main topic1..topic2 2>error &&
 	test_grep "invalid.*replay.refAction.*value" error
 '
 
@@ -407,10 +407,10 @@ test_expect_success 'argument to --revert must be a reference' '
 '
 
 test_expect_success 'cannot revert with multiple sources' '
-	cat >expect <<-\EOF &&
-	fatal: '"'"'--revert'"'"' cannot be used with multiple revision ranges because the ordering would be ill-defined
+	cat >expect <<-EOF &&
+	fatal: ${SQ}--revert${SQ} cannot be used with multiple revision ranges because the ordering would be ill-defined
 	EOF
-	test_must_fail git replay --revert main main topic1 topic2 2>actual &&
+	test_must_fail git replay --revert=main main topic1 topic2 2>actual &&
 	test_cmp expect actual
 '
 
@@ -420,7 +420,7 @@ test_expect_success 'using replay --revert to revert commits' '
 	test_when_finished "git branch -f topic4 $START" &&
 
 	# Revert commits I and J
-	git replay --revert topic4 topic4~2..topic4 &&
+	git replay --revert=topic4 topic4~2..topic4 &&
 
 	# Verify the revert commits were created (newest-first ordering
 	# means J is reverted first, then I on top)
@@ -452,7 +452,7 @@ test_expect_success 'using replay --revert in bare repo' '
 	test_when_finished "git -C bare update-ref refs/heads/topic4 $START" &&
 
 	# Revert commit J in bare repo
-	git -C bare replay --revert topic4 topic4~1..topic4 &&
+	git -C bare replay --revert=topic4 topic4~1..topic4 &&
 
 	# Verify revert was created
 	git -C bare log -1 --format=%s topic4 >actual &&
@@ -466,11 +466,11 @@ test_expect_success 'revert of revert uses Reapply' '
 	test_when_finished "git branch -f topic4 $START" &&
 
 	# First revert J
-	git replay --revert topic4 topic4~1..topic4 &&
+	git replay --revert=topic4 topic4~1..topic4 &&
 	REVERT_J=$(git rev-parse topic4) &&
 
 	# Now revert the revert - should become Reapply
-	git replay --revert topic4 topic4~1..topic4 &&
+	git replay --revert=topic4 topic4~1..topic4 &&
 
 	# Verify Reapply prefix and message format
 	test_commit_message topic4 <<-EOF
@@ -482,21 +482,21 @@ test_expect_success 'revert of revert uses Reapply' '
 
 test_expect_success 'git replay --revert with conflict' '
 	# conflict branch has C.conflict which conflicts with topic1s C
-	test_expect_code 1 git replay --revert conflict B..topic1
+	test_expect_code 1 git replay --revert=conflict B..topic1
 '
 
 test_expect_success 'git replay --revert incompatible with --contained' '
-	test_must_fail git replay --revert topic4 --contained topic4~1..topic4 2>error &&
+	test_must_fail git replay --revert=topic4 --contained topic4~1..topic4 2>error &&
 	test_grep "requires --onto" error
 '
 
 test_expect_success 'git replay --revert incompatible with --onto' '
-	test_must_fail git replay --revert topic4 --onto main topic4~1..topic4 2>error &&
+	test_must_fail git replay --revert=topic4 --onto=main topic4~1..topic4 2>error &&
 	test_grep "cannot be used together" error
 '
 
 test_expect_success 'git replay --revert incompatible with --advance' '
-	test_must_fail git replay --revert topic4 --advance main topic4~1..topic4 2>error &&
+	test_must_fail git replay --revert=topic4 --advance=main topic4~1..topic4 2>error &&
 	test_grep "cannot be used together" error
 '
 
-- 
2.53.0.310.g728cabbaf7
Previous: Toon ClaesNext: Kristoffer Haugsbakk
Message 2 of 25 in “Add option --ref to git-replay(1)”
  1. 0/3 Add option --ref to git-replay(1)Toon Claes, Mar 23, 2026
  2. 1/3 t3650: use option with value consistenly with equal signToon Claes, Mar 23, 2026
  3. Kristoffer HaugsbakkMar 23, 2026
  4. Junio C HamanoMar 23, 2026
  5. Toon ClaesMar 25, 2026
  6. 2/3 builtin/replay: improve documentation on optionsToon Claes, Mar 23, 2026
  7. 3/3 replay: allow to specify a ref with option --refToon Claes, Mar 23, 2026
  8. Tian YuchenMar 23, 2026
  9. Toon ClaesMar 25, 2026
  10. Kristoffer HaugsbakkMar 23, 2026
  11. Toon ClaesMar 25, 2026
  12. 0/3 Add option --ref to git-replay(1)Toon Claes, Mar 25, 2026
  13. 1/3 builtin/replay: mark options as not negatableToon Claes, Mar 25, 2026
  14. 2/3 replay: use stuck form in documentation and help messageToon Claes, Mar 25, 2026
  15. 3/3 replay: allow to specify a ref with option --refToon Claes, Mar 25, 2026
  16. Junio C HamanoMar 25, 2026
  17. Toon ClaesMar 31, 2026
  18. Junio C HamanoMar 25, 2026
  19. Junio C HamanoMar 26, 2026
  20. Toon ClaesMar 31, 2026
  21. Junio C HamanoMar 31, 2026
  22. 0/3 Add option --ref to git-replay(1)Toon Claes, Apr 1, 2026
  23. 1/3 builtin/replay: mark options as not negatableToon Claes, Apr 1, 2026
  24. 2/3 replay: use stuck form in documentation and help messageToon Claes, Apr 1, 2026
  25. 3/3 replay: allow to specify a ref with option --refToon Claes, Apr 1, 2026

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.