Re: diffstat witdth with one changed file
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:52
Andreas Schwab [off-list ref] writes:
Nguyen Thai Ngoc Duy [off-list ref] writes:quoted
With recent git, "git log --stat 90e6ef5", the first commit's diffstat uses full terminal width while the next one uses less than 80 chars. Both changes one file. Is it intentional?In commit 0e641b1 the file has only 41 lines of changes, so it looks intentional.
Correct. We do not try to make width of bars from two different commits comparable [*1*], but we do try to make them comparable within a single commit; for a commit that changes only a single path, you still have adds and removals to compare. The overall length is ideally one + or - per line if the graph fits the output width, but if that makes the graph too wide, we scale to fit in the output width. So a change with 41 lines gets only 41 +/- and does not consume full 80-column terminal. [Footnote] *1* This is very much on purpose; otherwise it will hurt the perceived latency of the command.