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

[BUG?] `config branch.autosetuprebase true` breaks `rev-parse --is-inside-work-tree`

From
Richard Hartmann <richih.mailinglist@gmail.com>
Date
Oct 8, 2014, 11:22 UTC
Message-ID
<CAD77+gTuqbZimEK-=gXY8o4wFqOicFvnQ5MnV6Fq1npuckwYFQ@mail.gmail.com>
Dear all,

I am not sure if this is an actual bug or just a corner case that's not worth to be fixed.

This was not tested with HEAD or even 2.1.2, but 2.1.1.

Notwithstanding if the setting is correct, shouldn't rev-parse be resilient enough to at least be able to tell if we're in a work tree? I understand why `git status` and the like would need to parse the full config, but determining if you're in a work tree should be possible in most if not all cases. Unless detached work trees get you into a situation where you really need to parse the whole config...

So this is not a real bug report, more of a "is this intended this way?"

As you can see, my custom prompt (via vcs_info in Zsh) breaks due to that which is how I noticed.

richih@titanium ~ % mkdir git_test richih@titanium ~ % cd git_test richih@titanium ~/git_test % git init Initialized empty Git repository in /home/richih/git_test/.git/ richih@titanium (git)-[master] ~/git_test % git rev-parse --is-inside-work-tree true richih@titanium (git)-[master] ~/git_test % git config branch.autosetuprebase true 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 [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [branch] autosetuprebase = true richih@titanium ~/git_test % git --version git version 2.1.1 richih@titanium ~/git_test %

Thanks, Richard

Next: Junio C Hamano
Message 1 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.