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

[PATCH 2/3] cherry-pick: demonstrate option amnesia

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 13, 2019, 18:26 UTC
Message-ID
<20190313182615.7351-2-phillip.wood123@gmail.com>
In-Reply-To
<20190313182615.7351-1-phillip.wood123@gmail.com>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

When cherry-pick stops for a conflict resolution it forgets --allow-empty --allow-empty-message and --keep-redundant-commits.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 t/t3507-cherry-pick-conflict.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 0db166152a..79e994cffa 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -25,6 +25,11 @@ test_expect_success setup '
 	test_commit base foo b &&
 	test_commit picked foo c &&
 	test_commit --signoff picked-signed foo d &&
+	git checkout -b topic initial &&
+	test_commit redundant-pick foo c redundant &&
+	git commit --allow-empty --allow-empty-message &&
+	git tag empty &&
+	git checkout master &&
 	git config advice.detachedhead false
 
 '
@@ -405,4 +410,23 @@ test_expect_success 'cherry-pick preserves sparse-checkout' '
 	test_i18ngrep ! "Changes not staged for commit:" actual
 '
 
+test_expect_failure 'cherry-pick --continue remembers --keep-redundant-commits' '
+	test_when_finished "git cherry-pick --abort || :" &&
+	pristine_detach initial &&
+	test_must_fail git cherry-pick --keep-redundant-commits picked redundant &&
+	echo c >foo &&
+	git add foo &&
+	git cherry-pick --continue
+'
+
+test_expect_failure 'cherry-pick --continue remembers --allow-empty and --allow-empty-message' '
+	test_when_finished "git cherry-pick --abort || :" &&
+	pristine_detach initial &&
+	test_must_fail git cherry-pick --allow-empty --allow-empty-message \
+				       picked empty &&
+	echo c >foo &&
+	git add foo &&
+	git cherry-pick --continue
+'
+
 test_done
-- 
2.21.0
Previous: Phillip WoodNext: Phillip Wood
Message 2 of 10 in “sequencer: break some long lines”
  1. 1/3 sequencer: break some long linesPhillip Wood, Mar 13, 2019
  2. 2/3 cherry-pick: demonstrate option amnesiaPhillip Wood, Mar 13, 2019
  3. 3/3 cherry-pick --continue: remember optionsPhillip Wood, Mar 13, 2019
  4. Johannes SchindelinMar 13, 2019
  5. Junio C HamanoMar 14, 2019
  6. separating regression test patches from fixes, was Re: [PATCH 3/3] cherry-pick --continue: remember optionsJohannes Schindelin, Mar 14, 2019
  7. Duy NguyenMar 14, 2019
  8. Junio C HamanoMar 18, 2019
  9. Johannes SchindelinMar 21, 2019
  10. Junio C HamanoMar 18, 2019

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.