summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/range-diff.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 73fea79601..930f273b85 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -20,7 +20,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
.diffopt = &diffopt,
.other_arg = &other_arg
};
- int simple_color = -1;
+ int simple_color = -1, left_only = 0, right_only = 0;
struct option range_diff_options[] = {
OPT_INTEGER(0, "creation-factor",
&range_diff_opts.creation_factor,
@@ -30,6 +30,10 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
OPT_PASSTHRU_ARGV(0, "notes", &other_arg,
N_("notes"), N_("passed to 'git log'"),
PARSE_OPT_OPTARG),
+ OPT_BOOL(0, "left-only", &left_only,
+ N_("only emit output related to the first range")),
+ OPT_BOOL(0, "right-only", &right_only,
+ N_("only emit output related to the second range")),
OPT_END()
};
struct option *options;
@@ -87,6 +91,8 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
FREE_AND_NULL(options);
range_diff_opts.dual_color = simple_color < 1;
+ range_diff_opts.left_only = left_only;
+ range_diff_opts.right_only = right_only;
res = show_range_diff(range1.buf, range2.buf, &range_diff_opts);
strvec_clear(&other_arg);