git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Pranit Bauva <pranit.bauva@gmail.com>
Cc: Christian Couder <christian.couder@gmail.com>,
	Git List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH 3/3] show-branch: use skip_prefix to drop magic numbers
Date: Tue, 14 Feb 2017 14:53:10 -0500	[thread overview]
Message-ID: <20170214195310.hlfke5vks6pnzmma@sigill.intra.peff.net> (raw)
In-Reply-To: <CAFZEwPOYGRGd5PWSfLRd6vMs35TT1ZzUSfr79fwRA4VzVjAWXA@mail.gmail.com>

On Wed, Feb 15, 2017 at 12:23:52AM +0530, Pranit Bauva wrote:

> Did you purposely miss the one in line number 278 of
> builtin/show-branch.c because I think you only touched up the parts
> which were related to "refs/" but didn't explicitly mention it in the
> commit message?
> 
>     if (starts_with(pretty_str, "[PATCH] "))
>         pretty_str += 8;

Not purposely. I was just fixing up the bits that I had noticed in the
earlier patches.

> diff --git a/builtin/show-branch.c b/builtin/show-branch.c
> index c03d3ec7c..19756595d 100644
> --- a/builtin/show-branch.c
> +++ b/builtin/show-branch.c
> @@ -275,8 +275,7 @@ static void show_one_commit(struct commit *commit, int no_name)
>  		pp_commit_easy(CMIT_FMT_ONELINE, commit, &pretty);
>  		pretty_str = pretty.buf;
>  	}
> -	if (starts_with(pretty_str, "[PATCH] "))
> -		pretty_str += 8;
> +	skip_prefix(pretty_str, "[PATCH] ", &pretty_str);

Yeah, I agree this the same type of fix and is worth including. Thanks!

-Peff

  reply	other threads:[~2017-02-14 19:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 15:48 [PATCH] show-branch: fix crash with long ref name Christian Couder
2017-02-14 17:25 ` Jeff King
2017-02-14 17:26   ` [PATCH 1/3] show-branch: drop head_len variable Jeff King
2017-02-14 17:27   ` [PATCH 2/3] show-branch: store resolved head in heap buffer Jeff King
2017-02-14 17:28   ` [PATCH 3/3] show-branch: use skip_prefix to drop magic numbers Jeff King
2017-02-14 18:53     ` Pranit Bauva
2017-02-14 19:53       ` Jeff King [this message]
2017-02-14 19:35   ` [PATCH] show-branch: fix crash with long ref name Junio C Hamano
2017-02-14 19:55     ` Jeff King
2017-02-14 21:29       ` Christian Couder
2017-02-15 21:40         ` Jeff King
2017-02-15 21:50           ` Junio C Hamano
2017-02-15 21:52             ` Jeff King
2017-02-16 12:40           ` Christian Couder
2017-02-17  5:03             ` 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=20170214195310.hlfke5vks6pnzmma@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=pranit.bauva@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).