diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2021-02-05 14:46:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-06 21:14:31 -0800 |
commit | f1ce6c191e9d15ce78041d8b6496c246b10d9b2d (patch) | |
tree | bd2e245ebc24622e25b7b1f0c1fbe821719ab4dc /builtin/log.c | |
parent | range-diff: simplify code spawning `git log` (diff) | |
download | tgif-f1ce6c191e9d15ce78041d8b6496c246b10d9b2d.tar.xz |
range-diff: combine all options in a single data structure
This will make it easier to implement the `--left-only` and
`--right-only` options.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r-- | builtin/log.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c index f23ccdbec3..300b1648d7 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1231,14 +1231,20 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file, */ struct diff_options opts; struct strvec other_arg = STRVEC_INIT; + struct range_diff_options range_diff_opts = { + .creation_factor = rev->creation_factor, + .dual_color = 1, + .diffopt = &opts, + .other_arg = &other_arg + }; + diff_setup(&opts); opts.file = rev->diffopt.file; opts.use_color = rev->diffopt.use_color; diff_setup_done(&opts); fprintf_ln(rev->diffopt.file, "%s", rev->rdiff_title); get_notes_args(&other_arg, rev); - show_range_diff(rev->rdiff1, rev->rdiff2, - rev->creation_factor, 1, &opts, &other_arg); + show_range_diff(rev->rdiff1, rev->rdiff2, &range_diff_opts); strvec_clear(&other_arg); } } |