From: Uwe Kleine-König Date: Wed, 13 Feb 2008 10:10:13 GMT Subject: [PATCH] new test: rev-list --cherry-pick excludes an empty commit against a superseding merge Message-ID: <1202897413-7762-1-git-send-email-Uwe.Kleine-Koenig@digi.com> In-Reply-To: <20080213092910.GA20219@digi.com> 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 --- 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