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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]