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

Re: [PATCH] Add git-config --remove-section, document --rename-section

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 2, 2007, 15:44 UTC
Message-ID
<Pine.LNX.4.63.0703021640440.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<45E814D9.7020104@lu.unisi.ch>
Hi,
On Fri, 2 Mar 2007, Paolo Bonzini wrote:
Show 17 quoted lines
> > Of course you would have to move "int removing" and the related two 
> > lines to rename_section(), too.
> > 
> > The diff would be shorter, and if you then rename the function to 
> > rename_or_remove_section() it becomes all clearer.
> 
> It's more different than it looks like.  For example, remove_section needs this,
> 
>         if (buf[i] == '[') {
>                 if (section_name_match (&buf[i + 1], name)) {
> 		} else
> 			...
> 	}
> 
> while rename_section can use
> 
>         if (buf[i] == '[' && section_name_match (&buf[i+1], old_name)) {
But it does not have to.
	if (buf[i] == '[') {
		if (section_name_match(&buf[i + 1], old_name) {
			if (new_name == NULL)
				remove = 1;
			else
				/* write new section */
			continue;
		}
		remove = 0;
	}
	if (!remove)
		/* write buf */

Ciao, Dscho

Previous: Paolo BonziniNext: Paolo Bonzini
Message 9 of 12 in “Add git-config --remove-section, document --rename-section”
  1. Add git-config --remove-section, document --rename-sectionPaolo Bonzini, Mar 1, 2007
  2. Alex RiesenMar 1, 2007
  3. add test for git-config --remove-sectionJohannes Schindelin, Mar 1, 2007
  4. Paolo BonziniMar 2, 2007
  5. Johannes SchindelinMar 1, 2007
  6. Paolo BonziniMar 2, 2007
  7. Johannes SchindelinMar 2, 2007
  8. Paolo BonziniMar 2, 2007
  9. Johannes SchindelinMar 2, 2007
  10. Paolo BonziniMar 2, 2007
  11. git-config: document --rename-section, provide --remove-sectionJohannes Schindelin, Mar 2, 2007
  12. Paolo BonziniMar 3, 2007

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.