diff options
author | Dragan Simic <dsimic@manjaro.org> | 2023-09-11 17:39:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-18 18:39:07 +0200 |
commit | bd48adc31d0522e7877aa494ce7df91581e09587 (patch) | |
tree | 453a553971c3d0127271fa77ddfbe34d700b6612 /builtin/diff.c | |
parent | The ninth batch (diff) | |
download | git-bd48adc31d0522e7877aa494ce7df91581e09587.tar.xz git-bd48adc31d0522e7877aa494ce7df91581e09587.zip |
diff --stat: add config option to limit filename width
Add new configuration option diff.statNameWidth=<width> that is equivalent
to the command-line option --stat-name-width=<width>, but it is ignored
by format-patch. This follows the logic established by the already
existing configuration option diff.statGraphWidth=<width>.
Limiting the widths of names and graphs in the --stat output makes sense
for interactive work on wide terminals with many columns, hence the support
for these configuration options. They don't affect format-patch because
it already adheres to the traditional 80-column standard.
Update the documentation and add more tests to cover new configuration
option diff.statNameWidth=<width>. While there, perform a few minor code
and whitespace cleanups here and there, as spotted.
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
-rw-r--r-- | builtin/diff.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/diff.c b/builtin/diff.c index 0b313549c7..c0f564273a 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -475,6 +475,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) /* Set up defaults that will apply to both no-index and regular diffs. */ rev.diffopt.stat_width = -1; + rev.diffopt.stat_name_width = -1; rev.diffopt.stat_graph_width = -1; rev.diffopt.flags.allow_external = 1; rev.diffopt.flags.allow_textconv = 1; |