Re: [PATCHv3] pretty: Initialize notes if %N is used

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Tuesday, April 13, 2010 - 4:07 am

On Tue, Apr 13, 2010 at 01:01:05PM +0200, Johannes Gilger wrote:


Ugh. I didn't even know we had such a thing. Those look like the only
ones that should be a problem, though. I'm glad to have factored out the
"want" code, now. At least it will all be in one spot.


Should this perhaps be:

  if (*placeholder == '+' || *placeholder == '-')
    placeholder++;

  switch (*placeholder) {
    case 'N': w->notes = 1; break;
  }

so that it will extend naturally if other placeholder lookups are needed
(since those ones also could have + or - markers).

Also, I just noticed that your case is missing a 'break'. Not a bug yet,
but it will be if somebody adds a new case. This is almost certainly my
fault from the original version I posted. :)

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] pretty.c: Don't expand %N without --show-notes, Johannes Gilger, (Sat Apr 10, 12:05 am)
Re: [PATCH] pretty.c: Don't expand %N without --show-notes, Junio C Hamano, (Sat Apr 10, 1:00 pm)
[PATCH] Notes: Connect the %N flag to --{show,no}-notes, Johannes Gilger, (Sat Apr 10, 2:30 pm)
Re: [PATCH] Notes: Connect the %N flag to --{show,no}-notes, Johannes Gilger, (Sat Apr 10, 3:20 pm)
[PATCH] pretty: Initialize notes if %N is used, Johannes Gilger, (Sun Apr 11, 7:54 am)
Re: [PATCH] pretty: Initialize notes if %N is used, Jeff King, (Mon Apr 12, 1:56 am)
[PATCHv2] pretty: Initialize notes if %N is used, Johannes Gilger, (Tue Apr 13, 1:59 am)
Re: [PATCHv2] pretty: Initialize notes if %N is used, Johannes Gilger, (Tue Apr 13, 3:36 am)
[PATCHv3] pretty: Initialize notes if %N is used, Johannes Gilger, (Tue Apr 13, 4:01 am)
Re: [PATCHv3] pretty: Initialize notes if %N is used, Jeff King, (Tue Apr 13, 4:07 am)
[PATCHv4] pretty: Initialize notes if %N is used, Johannes Gilger, (Tue Apr 13, 4:26 am)
Re: [PATCHv4] pretty: Initialize notes if %N is used, Junio C Hamano, (Tue Apr 13, 1:01 pm)
[PATCHv5] pretty: Initialize notes if %N is used, Johannes Gilger, (Tue Apr 13, 1:31 pm)