Re: [PATCH 3/3] show-branch: use skip_prefix to drop magic numbers
- From
Jeff King <peff@peff.net>
- Date
- Feb 14, 2017, 19:53 UTC
- Message-ID
- <20170214195310.hlfke5vks6pnzmma@sigill.intra.peff.net>
- In-Reply-To
- <CAFZEwPOYGRGd5PWSfLRd6vMs35TT1ZzUSfr79fwRA4VzVjAWXA@mail.gmail.com>
On Wed, Feb 15, 2017 at 12:23:52AM +0530, Pranit Bauva wrote:
Show 7 quoted lines
> 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.
Show 11 quoted lines
> 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