Re: [PATCH 1/2] Make section_name_match start on '[', and return the length on success
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 25, 2009, 17:39 UTC
- Message-ID
- <7vbpn8u0g7.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1248542170-sup-4264@utwig>
Alex Vandiver <alex@chmrr.net> writes:
Show 8 quoted lines
> At Sat Jul 25 10:09:56 -0400 2009, Johannes Schindelin wrote: >> Is this not unnecessary, given that we only call that function when we >> know that buf[0] == '[': > > Yes. However, given that I had changed the calling convention for the > code, (it used to be passed the string starting just _inside_ the > '['), I wanted to make the new calling convention clearer, and catch > any places that were using the old convention.
It's Ok. I do not think this is performance critical part of the system, and I'd feel safer with a bit of defensive programming like this, especially because "git config" that writes (reader is Ok) has traditionally been one of the most fragile part of the system.
Show 6 quoted lines
> I'm happy to submit a new version without it, if you wish. > >> I was a bit surprised that "offset" is not used further in your patch, but >> I saw that 2/2 uses it. > > Yeah, this hunk should probably have gone in 2/2 instead.
I actually thought about suggesting to squash these two patches into one, as the change in [1/2] only makes sense in the context of the [2/2], but decided against it.
I haven't applied (actually, I didn't even notice until this morning) the small documentation update from Nana. Have any comments on that one?