aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/diff-options.txt
diff options
context:
space:
mode:
authorDragan Simic <dsimic@manjaro.org>2023-09-11 17:39:44 +0200
committerJunio C Hamano <gitster@pobox.com>2023-09-18 09:39:07 -0700
commitbd48adc31d0522e7877aa494ce7df91581e09587 (patch)
tree453a553971c3d0127271fa77ddfbe34d700b6612 /Documentation/diff-options.txt
parentbda494f4043963b9ec9a1ecd4b19b7d1cd9a0518 (diff)
downloadgit-bd48adc31d0522e7877aa494ce7df91581e09587.tar.gz
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 'Documentation/diff-options.txt')
-rw-r--r--Documentation/diff-options.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index c07488b123..35fae7c87c 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -204,14 +204,15 @@ have to use `--diff-algorithm=default` option.
part. Maximum width defaults to terminal width, or 80 columns
if not connected to a terminal, and can be overridden by
`<width>`. The width of the filename part can be limited by
- giving another width `<name-width>` after a comma. The width
- of the graph part can be limited by using
- `--stat-graph-width=<width>` (affects all commands generating
- a stat graph) or by setting `diff.statGraphWidth=<width>`
- (does not affect `git format-patch`).
- By giving a third parameter `<count>`, you can limit the
- output to the first `<count>` lines, followed by `...` if
- there are more.
+ giving another width `<name-width>` after a comma or by setting
+ `diff.statNameWidth=<width>`. The width of the graph part can be
+ limited by using `--stat-graph-width=<width>` or by setting
+ `diff.statGraphWidth=<width>`. Using `--stat` or
+ `--stat-graph-width` affects all commands generating a stat graph,
+ while setting `diff.statNameWidth` or `diff.statGraphWidth`
+ does not affect `git format-patch`.
+ By giving a third parameter `<count>`, you can limit the output to
+ the first `<count>` lines, followed by `...` if there are more.
+
These parameters can also be set individually with `--stat-width=<width>`,
`--stat-name-width=<name-width>` and `--stat-count=<count>`.