git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucian Poston <lucian.poston@gmail.com>
To: git@vger.kernel.org
Cc: "Lucian Poston" <lucian.poston@gmail.com>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: [PATCH v3 3/7] Adjust stat width calculations to take --graph output into account
Date: Mon, 16 Apr 2012 03:44:51 -0700	[thread overview]
Message-ID: <1334573095-32286-4-git-send-email-lucian.poston@gmail.com> (raw)
In-Reply-To: <1334573095-32286-1-git-send-email-lucian.poston@gmail.com>

The recent change to compute the width of diff --stat did not take into
consideration the output from --graph. The consequence is that when both
options are used, e.g. in 'log --stat --graph', the lines are too long.

Adjust stat width calculations to take --graph output into account.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
---
 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index 377ec1e..0b61cf7 100644
--- a/diff.c
+++ b/diff.c
@@ -1445,7 +1445,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
 	 */
 
 	if (options->stat_width == -1)
-		width = term_columns();
+		width = term_columns() - options->output_prefix_length;
 	else
 		width = options->stat_width ? options->stat_width : 80;
 
-- 
1.7.3.4

  parent reply	other threads:[~2012-04-16 10:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 10:44 [PATCH v3 0/7] diff stat calculation adjustments Lucian Poston
2012-04-16 10:44 ` [PATCH v3 1/7] t4052: test --stat output with --graph Lucian Poston
2012-04-16 10:44 ` [PATCH v3 2/7] Add output_prefix_length to diff_options Lucian Poston
2012-04-16 18:48   ` Junio C Hamano
2012-04-18  2:31     ` Lucian Poston
2012-04-16 10:44 ` Lucian Poston [this message]
2012-04-16 10:44 ` [PATCH v3 4/7] t4052: Adjust --graph --stat output for prefixes Lucian Poston
2012-04-16 18:48   ` Junio C Hamano
2012-04-18  2:23     ` Lucian Poston
2012-04-16 10:44 ` [PATCH v3 5/7] t4052: Add tests to illustrate issues with restrictive COLUMNS Lucian Poston
2012-04-16 18:48   ` Junio C Hamano
2012-04-18  2:31     ` Lucian Poston
2012-04-16 10:44 ` [PATCH v3 6/7] Prevent graph_width of diff stat from falling below min Lucian Poston
2012-04-16 10:44 ` [PATCH v3 7/7] t4052: Adjust --stat output for minimum graph_width Lucian Poston
2012-04-16 19:30 ` [PATCH v3 0/7] diff stat calculation adjustments Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334573095-32286-4-git-send-email-lucian.poston@gmail.com \
    --to=lucian.poston@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).