All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Jeff King <peff@peff.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG] fetch output is ugly in 'next'
Date: Fri, 21 Oct 2016 09:50:49 -0700	[thread overview]
Message-ID: <xmqqd1itd4t2.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CACsJy8CkK8K0ty3fv9qyD7wwB+81VPB-P1UUCbDJTJ4iM0Y+Cw@mail.gmail.com> (Duy Nguyen's message of "Fri, 21 Oct 2016 20:07:22 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Fri, Oct 21, 2016 at 7:11 PM, Duy Nguyen <pclouds@gmail.com> wrote:
>> Yeah.. replacing the 4 DEFAULT_ABBREV in fetch.c with something
>> sensible should do it.
>
> Correction (if somebody will pick this up), it's
> TRANSPORT_SUMMARY_WIDTH that needs to be adjusted, not those four.

Yes, it used to be and it still is (2 * DEFAULT_ABBREV + 3) but in
the new world order where default-abbrev is often -1 the expression
does not make much sense.

Perhaps something along this line?

 transport.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/transport.h b/transport.h
index 18d2cf8275..5339fabbad 100644
--- a/transport.h
+++ b/transport.h
@@ -127,7 +127,7 @@ struct transport {
 #define TRANSPORT_PUSH_CERT 2048
 #define TRANSPORT_PUSH_ATOMIC 4096
 
-#define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
+#define TRANSPORT_SUMMARY_WIDTH (2 * (DEFAULT_ABBREV < 0 ? 7 : DEFAULT_ABBREV) + 3)
 #define TRANSPORT_SUMMARY(x) (int)(TRANSPORT_SUMMARY_WIDTH + strlen(x) - gettext_width(x)), (x)
 
 /* Returns a transport suitable for the url */

  reply	other threads:[~2016-10-21 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  0:26 [BUG] fetch output is ugly in 'next' Jeff King
2016-10-21 12:11 ` Duy Nguyen
2016-10-21 13:07   ` Duy Nguyen
2016-10-21 16:50     ` Junio C Hamano [this message]
2016-10-21 21:42       ` Jeff King
2016-10-21 22:14         ` Junio C Hamano
2016-10-21 22:39           ` [PATCH 0/3] " Junio C Hamano
2016-10-21 22:39             ` [PATCH 1/3] transport: pass summary_width down the callchain Junio C Hamano
2016-10-21 22:39             ` [PATCH 2/3] fetch: " Junio C Hamano
2016-10-21 22:39             ` [PATCH 3/3] transport: allow summary-width to be computed dynamically Junio C Hamano
2016-10-22  4:10               ` Jeff King
2016-10-22  4:39               ` Junio C Hamano
2016-10-22  5:04                 ` Jeff King
2016-10-22 16:25                   ` 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=xmqqd1itd4t2.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.