rev-list: documentation and test for --cherry-mark
authorMichael J Gruber <git@drmicha.warpmail.net>
Mon, 7 Mar 2011 12:31:41 +0000 (13:31 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Mar 2011 21:50:54 +0000 (13:50 -0800)
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-list.txt
Documentation/rev-list-options.txt
t/t6007-rev-list-cherry-pick-file.sh

index 5f47a13d3c6191a0029e7e64603518346b0198ee..8a891ca68dc9ab3e0d547256166d41db81bf22f5 100644 (file)
@@ -33,6 +33,7 @@ SYNOPSIS
             [ \--left-right ]
             [ \--left-only ]
             [ \--right-only ]
+            [ \--cherry-mark ]
             [ \--cherry-pick ]
             [ \--encoding[=<encoding>] ]
             [ \--(author|committer|grep)=<pattern> ]
index cebba62239ad8861160e79255fdbdc4800be5e05..4755b83d2d43457dc8c878f7f7cbee0d8842f254 100644 (file)
@@ -305,6 +305,11 @@ ifdef::git-rev-list[]
        to /dev/null as the output does not have to be formatted.
 endif::git-rev-list[]
 
+--cherry-mark::
+
+       Like `--cherry-pick` (see below) but mark equivalent commits
+       with `=` rather than omitting them, and inequivalent ones with `+`.
+
 --cherry-pick::
 
        Omit any commit that introduces the same change as
index cd089a913bb93abc882db5a128429dab0d0275db..37bd25eaaaf5cd4daaf59e39549891944874a4a5 100755 (executable)
@@ -99,6 +99,34 @@ test_expect_success '--cherry-pick bar does not come up empty (II)' '
        test_cmp actual.named expect
 '
 
+cat >expect <<EOF
++tags/F
+=tags/D
++tags/E
+=tags/C
+EOF
+
+test_expect_success '--cherry-mark' '
+       git rev-list --cherry-mark F...E -- bar > actual &&
+       git name-rev --stdin --name-only --refs="*tags/*" \
+               < actual > actual.named &&
+       test_cmp actual.named expect
+'
+
+cat >expect <<EOF
+<tags/F
+=tags/D
+>tags/E
+=tags/C
+EOF
+
+test_expect_success '--cherry-mark --left-right' '
+       git rev-list --cherry-mark --left-right F...E -- bar > actual &&
+       git name-rev --stdin --name-only --refs="*tags/*" \
+               < actual > actual.named &&
+       test_cmp actual.named expect
+'
+
 cat >expect <<EOF
 tags/E
 EOF