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

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 = garbage

In 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.

Previous: Richard HartmannNext: Junio C Hamano
Message 2 of 5 in “[BUG?] `config branch.autosetuprebase true` breaks `rev-parse --is-inside-work-tree`”
  1. Richard HartmannOct 8, 2014
  2. Junio C HamanoOct 8, 2014
  3. Junio C HamanoOct 8, 2014
  4. Tanay AbhraOct 8, 2014
  5. brian m. carlsonOct 8, 2014

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.