git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: diffstat witdth with one changed file

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
May 22, 2012, 12:50 UTC
Message-ID
<CACsJy8D1eMhyPm8b5D6vSuMDvebfX1hB2GUz82E8LeVhnWsqCQ@mail.gmail.com>
In-Reply-To
<4FBB2B4B.6030402@in.waw.pl>

On Tue, May 22, 2012 at 12:59 PM, Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> wrote:

Show 17 quoted lines
> On 05/21/2012 05:52 PM, Nguyen Thai Ngoc Duy wrote:
>> Hi,
>>
>> 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? I tend to think it's a bug
>> because with one-file changes, diffstat width is not important as we
>> have no other files to compare with.
> Hi,
> 90e6ef5 makes 502 additions/deletions, so it scales the +- part to the
> whole available terminal width. 90e6ef5^ does only 41 additions, so it
> can display the +- part unscaled without even filling the terminal width.
>
> Since we don't coordinate the diffstat width between different commits
> in the same git-log invocation, there's no way to make the diffstats use
> the same scale. Anyway, diffstat is only supposed to give a rough
> overview, and it does that here.
Yeah, others have explained it. And it makes sense.
> What output would you expect?

It just looks weird that while most of the commits fill half of my screen (200 char width), some diffstats strike a line through the right edge. And I did not see the reason for that in the beginning because I thought long lines only makes sense when compare to other lines.

-- 
Duy
Previous: Zbigniew Jędrzejewski-SzmekNext: Zbigniew Jędrzejewski-Szmek
Message 5 of 6 in “diffstat witdth with one changed file”
  1. Nguyen Thai Ngoc DuyMay 21, 2012
  2. Andreas SchwabMay 21, 2012
  3. Junio C HamanoMay 21, 2012
  4. Zbigniew Jędrzejewski-SzmekMay 22, 2012
  5. Nguyen Thai Ngoc DuyMay 22, 2012
  6. Zbigniew Jędrzejewski-SzmekMay 22, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.