# No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)

5 messages from 2025-10-19 to 2025-10-22. Participants: Дилян Палаузов, Ben Knoble, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/64353

## Дилян Палаузов, 2025-10-19 18:46

Subject: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Message-ID: <a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org>
URL: https://gitlist.dev/e/a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel%40aegee.org

```
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

```

## Ben Knoble, 2025-10-20 00:59

Subject: Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Message-ID: <01CB27C0-3378-4455-9779-33D8192BD4B1@gmail.com>
URL: https://gitlist.dev/e/01CB27C0-3378-4455-9779-33D8192BD4B1%40gmail.com
In-Reply-To: <a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org>

```

> Le 19 oct. 2025 à 14:50, Дилян Палаузов <dilyan.palauzov@aegee.org> a écrit :

[snip]

> 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.

You might be interested in git-jump in the contrib area.
```

## Jeff King, 2025-10-21 08:14

Subject: Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Message-ID: <20251021081422.GE259661@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20251021081422.GE259661%40coredump.intra.peff.net
In-Reply-To: <a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org>

```
On Sun, Oct 19, 2025 at 09:46:10PM +0300, Дилян Палаузов wrote:

> * 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.

It does seem funny that we have config options for 2 out of 3 of the
numbers you can specify via --stat. So adding diff.statTotalWidth or
something would make sense to me. I'd guess nobody has asked for it yet
because it defaults to the terminal width, so a static config option
risks overflowing your terminal if it's too high. On the other hand, if
we are going to show it in a pager anyway, they usually support
horizontal scrolling. And I guess it's all a matter of preference.

Anyway, one more possible hack: you can set COLUMNS if you want to
pretend you have a really big terminal. I.e., "export COLUMNS=200" would
probably do what you want without any new Git feature.

-Peff

```

## Junio C Hamano, 2025-10-21 14:46

Subject: Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Message-ID: <xmqqtszswbwq.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqtszswbwq.fsf%40gitster.g
In-Reply-To: <20251021081422.GE259661@coredump.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> Anyway, one more possible hack: you can set COLUMNS if you want to
> pretend you have a really big terminal. I.e., "export COLUMNS=200" would
> probably do what you want without any new Git feature.

;-)

Isn't that the exact purpose of that environment variable?  It feels
a bit unfair to the variable to call it a hack.

```

## Jeff King, 2025-10-22 09:15

Subject: Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)
Message-ID: <20251022091538.GD853931@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20251022091538.GD853931%40coredump.intra.peff.net
In-Reply-To: <xmqqtszswbwq.fsf@gitster.g>

```
On Tue, Oct 21, 2025 at 07:46:13AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > Anyway, one more possible hack: you can set COLUMNS if you want to
> > pretend you have a really big terminal. I.e., "export COLUMNS=200" would
> > probably do what you want without any new Git feature.
> 
> ;-)
> 
> Isn't that the exact purpose of that environment variable?  It feels
> a bit unfair to the variable to call it a hack.

Yes, though I think OP wanted something that would work for every
invocation of git, without having to pass it explicitly (otherwise they
could just use "--stat=200"). Setting COLUMNS=200 sounds like a risky
proposition if you run other programs besides Git.

-Peff

```
