]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff --stat: add config option to limit filename width
authorDragan Simic <dsimic@manjaro.org>
Mon, 11 Sep 2023 15:39:44 +0000 (17:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Sep 2023 16:39:07 +0000 (09:39 -0700)
commitbd48adc31d0522e7877aa494ce7df91581e09587
tree453a553971c3d0127271fa77ddfbe34d700b6612
parentbda494f4043963b9ec9a1ecd4b19b7d1cd9a0518
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>
Documentation/config/diff.txt
Documentation/diff-options.txt
builtin/diff.c
builtin/log.c
builtin/merge.c
builtin/rebase.c
diff.c
graph.c
t/t4052-stat-output.sh