Skip to content

Commit

Permalink
rev-list: documentation and test for --cherry-mark
Browse files Browse the repository at this point in the history
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and gitster committed Mar 9, 2011
1 parent adbbb31 commit cb56e30
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/git-rev-list.txt
Expand Up @@ -33,6 +33,7 @@ SYNOPSIS
[ \--left-right ]
[ \--left-only ]
[ \--right-only ]
[ \--cherry-mark ]
[ \--cherry-pick ]
[ \--encoding[=<encoding>] ]
[ \--(author|committer|grep)=<pattern> ]
Expand Down
5 changes: 5 additions & 0 deletions Documentation/rev-list-options.txt
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions t/t6007-rev-list-cherry-pick-file.sh
Expand Up @@ -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
Expand Down

0 comments on commit cb56e30

Please sign in to comment.