summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0b9c34)
raw | patch | inline | side by side (parent: e0b9c34)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Mon, 21 Feb 2011 16:09:12 +0000 (17:09 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 22 Feb 2011 00:34:05 +0000 (16:34 -0800) |
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-list.txt | patch | blob | history | |
Documentation/rev-list-options.txt | patch | blob | history | |
t/t6007-rev-list-cherry-pick-file.sh | patch | blob | history |
index 8e1e32908c31ddb8cb07046a25bcdb6dd38d74f5..5f47a13d3c6191a0029e7e64603518346b0198ee 100644 (file)
[ \--parents ]
[ \--timestamp ]
[ \--left-right ]
+ [ \--left-only ]
+ [ \--right-only ]
[ \--cherry-pick ]
[ \--encoding[=<encoding>] ]
[ \--(author|committer|grep)=<pattern> ]
index 44a2ef1de15bdce5d67a151a1cb6150031e57c7e..cebba62239ad8861160e79255fdbdc4800be5e05 100644 (file)
from branch A). With this option, such pairs of commits are
excluded from the output.
+--left-only::
+--right-only::
+
+ List only commits on the respective side of a symmetric range,
+ i.e. only those which would be marked `<` resp. `>` by
+ `--left-right`.
++
+For example, `--cherry-pick --right-only A...B` omits those
+commits from `B` which are in `A` or are patch-equivalent to a commit in
+`A`. In other words, this lists the `{plus}` commits from `git cherry A B`.
+More precisely, `--cherry-pick --right-only --no-merges` gives the exact
+list.
+
-g::
--walk-reflogs::
index 64b72a3e209b16d8de3d2975324f7fa7d9bed624..cd089a913bb93abc882db5a128429dab0d0275db 100755 (executable)
. ./test-lib.sh
-# A---B---D
+# A---B---D---F
# \
# \
# C---E
#
# B changes a file foo.c, adding a line of text. C changes foo.c as
# well as bar.c, but the change in foo.c was identical to change B.
-# D and C change bar in the same way, E differently.
+# D and C change bar in the same way, E and F differently.
test_expect_success setup '
echo Hallo > foo &&
git add bar &&
test_tick &&
git commit -m "D" &&
- git tag D
+ git tag D &&
+ echo Nello > bar &&
+ git add bar &&
+ test_tick &&
+ git commit -m "F" &&
+ git tag F
'
cat >expect <<EOF
'
cat >expect <<EOF
+<tags/F
>tags/E
EOF
test_expect_success '--cherry-pick bar does not come up empty (II)' '
- git rev-list --left-right --cherry-pick D...E -- bar > actual &&
+ git rev-list --left-right --cherry-pick 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
+
+test_expect_success '--cherry-pick --right-only' '
+ git rev-list --cherry-pick --right-only F...E -- bar > actual &&
+ git name-rev --stdin --name-only --refs="*tags/*" \
+ < actual > actual.named &&
+ test_cmp actual.named expect
+'
+
+test_expect_success '--cherry-pick --left-only' '
+ git rev-list --cherry-pick --left-only E...F -- bar > actual &&
git name-rev --stdin --name-only --refs="*tags/*" \
< actual > actual.named &&
test_cmp actual.named expect