git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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?

Previous: Alex VandiverNext: Johannes Schindelin
Message 16 of 17 in “Section renaming can lose content”
  1. 0/2 Section renaming can lose contentAlex Vandiver, Jul 24, 2009
  2. 1/2 Make section_name_match start on '[', and return the length on successAlex Vandiver, Jul 24, 2009
  3. 2/2 After renaming a section, print any trailing variable definitionsAlex Vandiver, Jul 24, 2009
  4. Nanako ShiraishiJul 24, 2009
  5. Alex VandiverJul 24, 2009
  6. Make git config fail on variables with no section, as documentedAlex Vandiver, Jul 26, 2009
  7. Johannes SchindelinJul 26, 2009
  8. Alex VandiverJul 26, 2009
  9. Johannes SchindelinJul 26, 2009
  10. Alex VandiverJul 26, 2009
  11. Junio C HamanoJul 24, 2009
  12. (unknown)Nanako Shiraishi, Jul 25, 2009
  13. Johannes SchindelinJul 25, 2009
  14. Johannes SchindelinJul 25, 2009
  15. Alex VandiverJul 25, 2009
  16. Junio C HamanoJul 25, 2009
  17. Johannes SchindelinJul 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.