summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb56e30)
raw | patch | inline | side by side (parent: cb56e30)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Mon, 7 Mar 2011 12:31:42 +0000 (13:31 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 9 Mar 2011 21:50:54 +0000 (13:50 -0800) |
At the porcelain level, because by definition there are many more contributors
than integrators, it makes sense to give a handy short-hand for --right-only
used with --cherry-mark and --no-merges. Make it so.
In other words, this provides "git cherry with rev-list interface".
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
than integrators, it makes sense to give a handy short-hand for --right-only
used with --cherry-mark and --no-merges. Make it so.
In other words, this provides "git cherry with rev-list interface".
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/rev-list-options.txt | patch | blob | history | |
revision.c | patch | blob | history |
index 4755b83d2d43457dc8c878f7f7cbee0d8842f254..95d209c11da4ab829d0617894cad637f96da3f24 100644 (file)
More precisely, `--cherry-pick --right-only --no-merges` gives the exact
list.
+--cherry::
+
+ A synonym for `--right-only --cherry-mark --no-merges`; useful to
+ limit the output to the commits on our side and mark those that
+ have been applied to the other side of a forked history with
+ `git log --cherry upstream...mybranch`, similar to
+ `git cherry upstream mybranch`.
+
-g::
--walk-reflogs::
diff --git a/revision.c b/revision.c
index 36022a6f6b95b77cd5fb5667ba9930a2ace29f9f..51372f650a4ecbb40c557a916c3f82d7276d9dfb 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -1289,12 +1289,20 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->left_right = 1;
} else if (!strcmp(arg, "--left-only")) {
if (revs->right_only)
- die("--left-only is incompatible with --right-only");
+ die("--left-only is incompatible with --right-only"
+ " or --cherry");
revs->left_only = 1;
} else if (!strcmp(arg, "--right-only")) {
if (revs->left_only)
die("--right-only is incompatible with --left-only");
revs->right_only = 1;
+ } else if (!strcmp(arg, "--cherry")) {
+ if (revs->left_only)
+ die("--cherry is incompatible with --left-only");
+ revs->cherry_mark = 1;
+ revs->right_only = 1;
+ revs->no_merges = 1;
+ revs->limited = 1;
} else if (!strcmp(arg, "--count")) {
revs->count = 1;
} else if (!strcmp(arg, "--cherry-mark")) {