{"thread":{"id":"64353","subject":"No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","startedAt":"2025-10-19T18:50:08Z","lastAt":"2025-10-22T09:15:39Z","messageCount":5,"participants":["Дилян Палаузов","Ben Knoble","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"529153","messageId":"a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org","threadId":"64353","inReplyTo":null,"subject":"No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","fromName":"Дилян Палаузов","fromEmail":"dilyan.palauzov@aegee.org","sentAt":"2025-10-19T18:46:10Z","receivedAt":"2025-10-19T18:50:08Z","isPatch":false,"sender":{"key":"dilyan.palauzov@aegee.org","avatar":null},"body":"Hello,\n\nAfter `git diff --stat` determines the available width, it uses correctly all available space for the file paths and names:\n\n```\n$ git show --stat --oneline \n0fb93104ba (HEAD -> java223/main) SourceGenerator: avoid delayed actions after the bundle is deactivated\n .../main/java/org/openhab/automation/java223/internal/Java223ScriptEngineFactory.java    |  1 +\n .../java/org/openhab/automation/java223/internal/codegeneration/SourceGenerator.java     | 16 +++++++++++-----\n 2 files changed, 12 insertions(+), 5 deletions(-)\n```\nhttps://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 .\n\nI set in /etc/gitconfig:\n[diff]\n        statGraphWidth = 200\n        statNameWidth = 200\n\nwhich is effectively the same as calling:\n```\n$ git show --stat-graph-width=200 --stat-graph-width=200 --oneline\n0fb93104ba (HEAD -> java223/main) SourceGenerator: avoid delayed actions after the bundle is deactivated\n .../main/java/org/openhab/automation/java223/internal/Java223ScriptEngineFactory.java    |  1 +\n .../java/org/openhab/automation/java223/internal/codegeneration/SourceGenerator.java     | 16 +++++++++++-----\n 2 files changed, 12 insertions(+), 5 deletions(-)\n```\nThere 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).\n\nThe 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.\n\n* 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.\n\nGreetings\n  Дилян\n---\ngit 2.51.0\n"},{"id":"529156","messageId":"01CB27C0-3378-4455-9779-33D8192BD4B1@gmail.com","threadId":"64353","inReplyTo":"a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org","subject":"Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-10-20T00:59:30Z","receivedAt":"2025-10-20T00:59:42Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 19 oct. 2025 à 14:50, Дилян Палаузов <dilyan.palauzov@aegee.org> a écrit :\n\n[snip]\n\n> 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.\n\nYou might be interested in git-jump in the contrib area."},{"id":"529239","messageId":"20251021081422.GE259661@coredump.intra.peff.net","threadId":"64353","inReplyTo":"a6ce209d120ca6acf0f5dd04521cb96ac1337a54.camel@aegee.org","subject":"Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2025-10-21T08:14:22Z","receivedAt":"2025-10-21T08:14:23Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 19, 2025 at 09:46:10PM +0300, Дилян Палаузов wrote:\n\n> * Please either alter the option `diff.statGraphWidth` to enlarge the\n> available space (broader than the terminal width), or add an option to\n> `git config` to set the available space for `--stat`.  This option\n> should eventually allow always to print the full path and filenames.\n\nIt does seem funny that we have config options for 2 out of 3 of the\nnumbers you can specify via --stat. So adding diff.statTotalWidth or\nsomething would make sense to me. I'd guess nobody has asked for it yet\nbecause it defaults to the terminal width, so a static config option\nrisks overflowing your terminal if it's too high. On the other hand, if\nwe are going to show it in a pager anyway, they usually support\nhorizontal scrolling. And I guess it's all a matter of preference.\n\nAnyway, one more possible hack: you can set COLUMNS if you want to\npretend you have a really big terminal. I.e., \"export COLUMNS=200\" would\nprobably do what you want without any new Git feature.\n\n-Peff\n"},{"id":"529296","messageId":"xmqqtszswbwq.fsf@gitster.g","threadId":"64353","inReplyTo":"20251021081422.GE259661@coredump.intra.peff.net","subject":"Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-21T14:46:13Z","receivedAt":"2025-10-21T14:46:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Anyway, one more possible hack: you can set COLUMNS if you want to\n> pretend you have a really big terminal. I.e., \"export COLUMNS=200\" would\n> probably do what you want without any new Git feature.\n\n;-)\n\nIsn't that the exact purpose of that environment variable?  It feels\na bit unfair to the variable to call it a hack.\n"},{"id":"529402","messageId":"20251022091538.GD853931@coredump.intra.peff.net","threadId":"64353","inReplyTo":"xmqqtszswbwq.fsf@gitster.g","subject":"Re: No config option for `git diff --stat` to always show the full file path and name (without .../ abbreviations)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2025-10-22T09:15:38Z","receivedAt":"2025-10-22T09:15:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 21, 2025 at 07:46:13AM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Anyway, one more possible hack: you can set COLUMNS if you want to\n> > pretend you have a really big terminal. I.e., \"export COLUMNS=200\" would\n> > probably do what you want without any new Git feature.\n> \n> ;-)\n> \n> Isn't that the exact purpose of that environment variable?  It feels\n> a bit unfair to the variable to call it a hack.\n\nYes, though I think OP wanted something that would work for every\ninvocation of git, without having to pass it explicitly (otherwise they\ncould just use \"--stat=200\"). Setting COLUMNS=200 sounds like a risky\nproposition if you run other programs besides Git.\n\n-Peff\n"}]}