Re: diffstat witdth with one changed file
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 21, 2012, 22:20 UTC
- Message-ID
- <7vehqd6urj.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <m2obphcubh.fsf@igel.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 8 quoted lines
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes: > >> 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.