git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Jakub Narębski" <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: Karthik Nayak <karthik.188@gmail.com>,
	Guillaume Wenzek <guillaume.wenzek@gmail.com>
Subject: Re: [PATCH] branch: honor --abbrev/--no-abbrev in --list mode
Date: Thu, 9 Mar 2017 14:25:08 +0100	[thread overview]
Message-ID: <4d09ad56-96ac-75d3-c9df-0c23b805b478@gmail.com> (raw)
In-Reply-To: <xmqqvarj1kix.fsf_-_@gitster.mtv.corp.google.com>

W dniu 08.03.2017 o 23:16, Junio C Hamano pisze:
 
> diff --git a/builtin/branch.c b/builtin/branch.c
> index cbaa6d03c0..537c47811a 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -335,9 +335,18 @@ static char *build_format(struct ref_filter *filter, int maxwidth, const char *r
>  		    branch_get_color(BRANCH_COLOR_CURRENT));
>  
>  	if (filter->verbose) {
> +		struct strbuf obname = STRBUF_INIT;
> +
> +		if (filter->abbrev < 0)
> +			strbuf_addf(&obname, "%%(objectname:short)");
> +		else if (!filter->abbrev)
> +			strbuf_addf(&obname, "%%(objectname)");
> +		else
> +			strbuf_addf(&obname, " %%(objectname:short=%d) ", filter->abbrev);
                                              ^                       ^
I wonder why the last one has leading space --/ and trailing one -----/
The rest (for default abbrev and for no abbrev do not).

-- 
Jakub Narębski


  reply	other threads:[~2017-03-09 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 18:14 BUG Report: git branch ignore --no-abbrev flag Guillaume Wenzek
2017-03-08 18:33 ` Junio C Hamano
2017-03-08 21:59   ` Junio C Hamano
2017-03-08 22:16     ` [PATCH] branch: honor --abbrev/--no-abbrev in --list mode Junio C Hamano
2017-03-09 13:25       ` Jakub Narębski [this message]
2017-03-10 16:45         ` Junio C Hamano
2017-03-09  9:44     ` BUG Report: git branch ignore --no-abbrev flag Guillaume Wenzek
2017-03-09 10:38       ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=4d09ad56-96ac-75d3-c9df-0c23b805b478@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guillaume.wenzek@gmail.com \
    --cc=karthik.188@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).