Code

log --cherry: a synonym
[git.git] / revision.c
index 36022a6f6b95b77cd5fb5667ba9930a2ace29f9f..51372f650a4ecbb40c557a916c3f82d7276d9dfb 100644 (file)
@@ -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")) {