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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 29, 2006, 04:07 UTC
Message-ID
<Pine.LNX.4.63.0609290551510.14200@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vd59fquc5.fsf@assigned-by-dhcp.cox.net>
Hi,
On Thu, 28 Sep 2006, Junio C Hamano wrote:
> 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.

I see that you care deeply about the 7 column example. In that case, yes, I would rather have columns be rounded down to the next even number.

I care more about the consistency: if there are changes, I want to see them, and it should be linear: the more changes, the more plusses or minusses.

Ciao, Dscho

P.S.: here's a patch on top of my last one: -- snip -- [PATCH] force even diffstat width

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 diff.c |    3 ++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 53c30bd..2a898e6 100644
--- a/diff.c
+++ b/diff.c
@@ -729,6 +729,9 @@ static void show_stats(struct diffstat_t
 	else
 		width = max_change;
 
+	/* force width to be even */
+	width &= ~1;
+
 	for (i = 0; i < data->nr; i++) {
 		const char *prefix = "";
 		char *name = data->files[i]->name;
-- 
1.4.2.1.g1a99e1-dirty
Previous: Junio C Hamano
Message 5 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.