From: Junio C Hamano Date: Mon, 19 Nov 2018 07:24:40 +0000 (+0900) Subject: Merge branch 'nd/format-patch-cover-letter-stat-width' X-Git-Tag: v2.20.0-rc1~15 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/dc7accd7554795bf094ca43518d52fffae502ea3?ds=inline;hp=--cc Merge branch 'nd/format-patch-cover-letter-stat-width' "git format-patch --stat=" can be used to specify the width used by the diffstat (shown in the cover letter). * nd/format-patch-cover-letter-stat-width: format-patch: respect --stat in cover letter's diffstat --- dc7accd7554795bf094ca43518d52fffae502ea3 diff --cc builtin/log.c index 9f2d987294,e0ae6aad43..0fe6f9ba1e --- a/builtin/log.c +++ b/builtin/log.c @@@ -1004,26 -998,6 +1004,24 @@@ static char *find_branch_name(struct re return branch; } +static void show_diffstat(struct rev_info *rev, + struct commit *origin, struct commit *head) +{ + struct diff_options opts; + + memcpy(&opts, &rev->diffopt, sizeof(opts)); + opts.output_format = DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT; - opts.stat_width = MAIL_DEFAULT_WRAP; - + diff_setup_done(&opts); + + diff_tree_oid(get_commit_tree_oid(origin), + get_commit_tree_oid(head), + "", &opts); + diffcore_std(&opts); + diff_flush(&opts); + + fprintf(rev->diffopt.file, "\n"); +} + static void make_cover_letter(struct rev_info *rev, int use_stdout, struct commit *origin, int nr, struct commit **list,