summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-03-07 13:31:42 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-09 13:50:54 -0800
commit94f605ec0798a1f494023b72cd0d1f10b7a264f7 (patch)
tree0f9c37f34ffe994226e10e3aa423aa6b22eb057c /revision.c
parentcb56e3093a1b25e105df44640e2224c8f6e6b893 (diff)
downloadgit-94f605ec0798a1f494023b72cd0d1f10b7a264f7.tar.gz
log --cherry: a synonym
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>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 36022a6f6b..51372f650a 100644
--- 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")) {