From: "Дилян Палаузов" <dilyan.palauzov@aegee.org>
To: git <git@vger.kernel.org>
Subject: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Date: Sun, 19 Oct 2025 21:46:10 +0300 [thread overview]
Message-ID: <a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org> (raw)
Hello,
After `git diff --stat` determines the available width, it uses correctly all available space for the file paths and names:
```
$ git show --stat --oneline
0fb93104ba (HEAD -> java223/main) SourceGenerator: avoid delayed actions after the bundle is deactivated
.../main/java/org/openhab/automation/java223/internal/Java223ScriptEngineFactory.java | 1 +
.../java/org/openhab/automation/java223/internal/codegeneration/SourceGenerator.java | 16 +++++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
```
https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---statwidthname-widthcount describes that after --stat can be entered up to three numbers, two of which can be set by a config option. The same options apply also for show --stat : https://git-scm.com/docs/git-show#Documentation/git-show.txt---statwidthname-widthcount .
I set in /etc/gitconfig:
[diff]
statGraphWidth = 200
statNameWidth = 200
which is effectively the same as calling:
```
$ git show --stat-graph-width=200 --stat-graph-width=200 --oneline
0fb93104ba (HEAD -> java223/main) SourceGenerator: avoid delayed actions after the bundle is deactivated
.../main/java/org/openhab/automation/java223/internal/Java223ScriptEngineFactory.java | 1 +
.../java/org/openhab/automation/java223/internal/codegeneration/SourceGenerator.java | 16 +++++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
```
There is no difference. diff.statGraphWidth / diff.statNameWidth / --stat-graph-width= / --stat-graph-width=200 set some number of columns within the available space. But I want to change the size of the available space to defaut to 200 (or to infinity).
The reason is that I can then copy the file path (e.g. with the mouse) from the git --stat output and open it immediately with less or emacs.
* Please either alter the option `diff.statGraphWidth` to enlarge the available space (broader than the terminal width), or add an option to `git config` to set the available space for `--stat`. This option should eventually allow always to print the full path and filenames.
Greetings
Дилян
---
git 2.51.0
next reply other threads:[~2025-10-19 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-19 18:46 Дилян Палаузов [this message]
2025-10-20 0:59 ` No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations) Ben Knoble
2025-10-21 8:14 ` Jeff King
2025-10-21 14:46 ` Junio C Hamano
2025-10-22 9:15 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org \
--to=dilyan.palauzov@aegee.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).