[PATCH] new test: rev-list --cherry-pick excludes an empty commit against a superseding merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently rev-list --cherry-pick kicks out two commits if they introduce the
same change to their first parent and ignores other parents.  This can be bad
if both sides used the ours strategy to supersede old development branches.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@xxxxxxxx>
---
 t/t6007-rev-list-cherry-pick-file.sh |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

Hello,

I'm not sure if combined diff is the right term.  I'm open for a better
one.

Moreover I'm not happy with the shortlog, maybe someone has a better
suggestion?

diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh
index 4b8611c..26f62e1 100755
--- a/t/t6007-rev-list-cherry-pick-file.sh
+++ b/t/t6007-rev-list-cherry-pick-file.sh
@@ -29,7 +29,13 @@ test_expect_success setup '
 	git checkout branch foo &&
 	test_tick &&
 	git commit -m "B" &&
-	git tag B
+	git tag B &&
+	test_tick &&
+	git checkout -b emptymerge A &&
+	git merge --no-ff -s ours master branch &&
+	test_tick &&
+	git checkout -b empty A &&
+	git commit --allow-empty -m empty
 '
 
 test_expect_success '--cherry-pick foo comes up empty' '
@@ -54,4 +60,10 @@ test_expect_success '--cherry-pick with independent, but identical branches' '
 		HEAD...master -- foo)"
 '
 
+# don't kick out commits c1, c2 with diff c1 c1^ == diff c2 c2^ but 
+# with different combined diffs
+test_expect_failure '--cherry-pick with a superseding merge and an empty commit' '
+	test "4" == "$(git rev-list --cherry-pick empty...emptymerge | wc -l)"
+'
+
 test_done
-- 
1.5.4

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux