Re: Minor bug in git branch --set-upstream-to adding superfluous branch section to config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phil Haack <haacked@xxxxxxxxx> writes:

> Hello there! Please /cc me with responses as I'm not on the mailing list.
>
> I'm using git version 1.8.1.msysgit.1 and I ran into a very minor issue. It
> doesn't actually seem to affect operations, but I thought I'd report it in case
> someone felt it was worth cleaning up.

I do not think this is limited to "branch --set-whatever".

> If you run the following set of commands:
>
>     git checkout -b some-branch
>     git push origin some-branch
>     git branch --set-upstream-to origin/some-branch
>     git branch --unset-upstream some-branch

This step causes the removal of the last variable in a configuration
section, which leaves an empty section.  As the code to add a new
variable to the configuration, trying to reuse an existing section
header, does not pay attention to an empty section, you end up with
an empty section, followed by a new one.

Either removal of configuration variable should be taught to remove
the section header when a section becomes empty, or addition of
configuration variable should be taught to notice an empty section
header.



>     git branch --set-upstream-to origin/some-branch
>
> You get the following result in the .git\config file
>
>     [branch "some-branch"]
>     [branch "some-branch"]
>         remote = origin
>         merge = refs/heads/some-branch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]