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

[PATCH 2/5] Add test for cherry-pick --skip-redundant-commits

From
David Greene <greened@obbligato.org>
Date
Jan 11, 2016, 05:00 UTC
Message-ID
<1452488421-26823-3-git-send-email-greened@obbligato.org>
In-Reply-To
<1452488421-26823-1-git-send-email-greened@obbligato.org>
From: "David A. Greene" <greened@obbligato.org>

Test that --skip-redundant commits suppresses an abort when cherry-picking a redundant commit.

Signed-off-by: David A. Greene <greened@obbligato.org>
---
 t/t3514-cherry-pick-redundant.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 t/t3514-cherry-pick-redundant.sh
diff --git a/t/t3514-cherry-pick-redundant.sh b/t/t3514-cherry-pick-redundant.sh
new file mode 100755
index 0000000..c433344
--- /dev/null
+++ b/t/t3514-cherry-pick-redundant.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description='git cherry-pick tests for redundant commits
+
+This test runs git cherry-pick and tests handling of redundant commits.
+'
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	test_commit one &&
+	test_commit two &&
+	test_commit three
+'
+
+test_expect_success 'cherry-pick redundant commit fails' '
+	git branch test-start &&
+	git reset --hard HEAD~2 &&
+	git cherry-pick test-start &&
+	test_must_fail git cherry-pick test-start
+'
+
+test_expect_success 'cherry-pick with --skip-redundant-commits' '
+	git cherry-pick --skip-redundant-commits test-start
+'
+
+test_done
-- 
2.6.1
Previous: David A. GreeneNext: David Greene
Message 5 of 9 in “Teach cherry-pick and rebase to ignore redundant commits”
  1. Teach cherry-pick and rebase to ignore redundant commitsDavid Greene, Jan 11, 2016
  2. 1/5 Teach cherry-pick to skip redundant commits if askedDavid Greene, Jan 11, 2016
  3. Junio C HamanoJan 11, 2016
  4. David A. GreeneJan 12, 2016
  5. 2/5 Add test for cherry-pick --skip-redundant-commitsDavid Greene, Jan 11, 2016
  6. 3/5 Add --skip-redundant-commits option to rebaseDavid Greene, Jan 11, 2016
  7. 4/5 Add test for redundant rebaseDavid Greene, Jan 11, 2016
  8. 5/5 Add test for rebase with merges amd redundant commitsDavid Greene, Jan 11, 2016
  9. Eric SunshineJan 11, 2016

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.