Re: [BUG] fetch output is ugly in 'next'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 21, 2016, 16:50 UTC
- Message-ID
- <xmqqd1itd4t2.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACsJy8CkK8K0ty3fv9qyD7wwB+81VPB-P1UUCbDJTJ4iM0Y+Cw@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 6 quoted lines
> 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 */