Re: git branch --editdescription fatal error

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

 



2017-01-06 18:55 GMT+01:00 Stefan Beller <sbeller@xxxxxxxxxx>:
> On Fri, Jan 6, 2017 at 9:25 AM, Jake Lambert <jake@xxxxxxxxxx> wrote:
>> Hello,
>>
>> When executing "git branch <branch> --edit-description" on a branch with no description set, I get "fatal: could not unset 'branch.<branch>.description". It would seem that the unsetting piece should occur only after checking if it was set in the first place.
>
> That seems strange. Is it possible that your config is not writable?
> (.git/config, ~/gitconfig, you'd need to find out where the <branch>
> is configured already via git config --global/--system/--local --list)
>

Have you actually tried to reproduce this issue? I'm on current next
and can reproduce the problem.

It seems Git is not happy with unsetting non-existent configs. And at
least the following piece of code
seems to be there since 10bea152a (Add functions git_config_set() and
git_config_set_multivar(), 2005-11-17).

config.c:2212
/* if nothing to unset, or too many matches, error out */
if ((store.seen == 0 && value == NULL) ||

I wonder why it's an error to remove something that doesn't exist
except the case we 'know' it
exists because of further actions. I don't think this is a thing, though.
Just for the record: `git config --unset branch.$branch.description`
does return with code "5" here as well.

I think removing things that don't exist should behave the same like
removing things that do exist, with
a success.

Ralf




[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]