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

Re: [PATCH] --stat: ensure at least one '-' for deletions, and one '+' for additions

From
Junio C Hamano <junkio@cox.net>
Date
Sep 29, 2006, 02:28 UTC
Message-ID
<7vd59fquc5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0609281942360.14200@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> However, I would argue it's actually an improvement. If you have as many 
> additions as deletions, there should be an equal number of '-' and '+'.
That's one way to look at it.

Now how would you explain that a file that had 5 adds and 5 deletes gets three pluses and three minuses while another file that had 10 adds and no delets gets seven pluses?

Compute total and add, make del=total-add:
	foo |   10 ++++---
        bar |   10 +++++++
Compute add and del independently:
	foo |   10 +++---
        bar |   10 +++++++
> After all, the integer number of symbols is just an approximation anyway.

Yes, and my guess is that the graph is usually much wider than 7 columns as depicted above, so 3 vs 4 inconsistency in the former is less noticeable than 6 vs 7 inconsistency in the latter to the eye. If we have to make a compromise, I think getting the lines for the files that have the same number of changes to line up at the right end would be more important.

Another way is what I suggested earlier -- if the width is odd, drop one to avoid this problem altogether. That would also be acceptable and probably be more consistent.

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 5 in “--stat: ensure at least one '-' for deletions, and one '+' for additions”
  1. --stat: ensure at least one '-' for deletions, and one '+' for additionsJohannes Schindelin, Sep 28, 2006
  2. Junio C HamanoSep 28, 2006
  3. Johannes SchindelinSep 28, 2006
  4. Junio C HamanoSep 29, 2006
  5. Johannes SchindelinSep 29, 2006

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.