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

From: Paolo Bonzini <[email-masked]>
Date: Fri, 02 Mar 2007 13:13:13 +0100

> 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)) {

and has more indenting in it.  The amount of indentation in the combined function is not makign things easier to read.

Paolo