Re: [BUG?] `config branch.autosetuprebase true` breaks `rev-parse --is-inside-work-tree`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 8, 2014, 17:35 UTC
- Message-ID
- <xmqqppe2bh1p.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAD77+gTuqbZimEK-=gXY8o4wFqOicFvnQ5MnV6Fq1npuckwYFQ@mail.gmail.com>
Richard Hartmann <richih.mailinglist@gmail.com> writes:
Show 8 quoted lines
> So this is not a real bug report, more of a "is this intended this way?" > richih@titanium ~/git_test % git rev-parse --is-inside-work-tree > error: Malformed value for branch.autosetuprebase > fatal: bad config file line 8 in .git/config > richih@titanium ~/git_test % cat .git/config > ... > [branch] > autosetuprebase = true
It does not seem to be limited to rev-parse but having a malformed configuration for that variable would break everything Git, which certainly is not how it is supposed to work. It also seems that the breakage dates back very far into the past (I checked 1.7.0 and it seems to be broken the same way).
The same breakage exists for branch.autosetupmerge, I think, e.g.
[branch]
autosetupmerge = garbageIn config.c, git_default_branch_config() must be corrected to set git_branch_track and autorebase to BRANCH_TRACK_MALFORMED and AUTOREBASE_MALFORMED and the users of these two variables must be fixed to deal with the "malformed in the configuration" cases, I think. The error should happen only in the codepath where we need the value, and no other places.