diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-17 17:21:41 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-17 17:21:41 -0800 |
commit | dadc91ff0c15b655070ad334a27a734e91635bd5 (patch) | |
tree | c53f828a0941fae682ee087bd21e935de607e2e5 /log-tree.c | |
parent | Merge branch 'js/range-diff-wo-dotdot' (diff) | |
parent | range-diff: offer --left-only/--right-only options (diff) | |
download | tgif-dadc91ff0c15b655070ad334a27a734e91635bd5.tar.xz |
Merge branch 'js/range-diff-one-side-only'
The "git range-diff" command learned "--(left|right)-only" option
to show only one side of the compared range.
* js/range-diff-one-side-only:
range-diff: offer --left-only/--right-only options
range-diff: move the diffopt initialization down one layer
range-diff: combine all options in a single data structure
range-diff: simplify code spawning `git log`
range-diff: libify the read_patches() function again
range-diff: avoid leaking memory in two error code paths
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/log-tree.c b/log-tree.c index e048467650..e7dab99950 100644 --- a/log-tree.c +++ b/log-tree.c @@ -808,6 +808,11 @@ void show_log(struct rev_info *opt) if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) { struct diff_queue_struct dq; struct diff_options opts; + struct range_diff_options range_diff_opts = { + .creation_factor = opt->creation_factor, + .dual_color = 1, + .diffopt = &opts + }; memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff)); DIFF_QUEUE_CLEAR(&diff_queued_diff); @@ -822,8 +827,7 @@ void show_log(struct rev_info *opt) opts.file = opt->diffopt.file; opts.use_color = opt->diffopt.use_color; diff_setup_done(&opts); - show_range_diff(opt->rdiff1, opt->rdiff2, - opt->creation_factor, 1, &opts, NULL); + show_range_diff(opt->rdiff1, opt->rdiff2, &range_diff_opts); memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff)); } |