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
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 8, 2014, 20:09 UTC
Message-ID
<20141008200936.GA19492@vauxhall.crustytoothpaste.net>
In-Reply-To
<CAD77+gTuqbZimEK-=gXY8o4wFqOicFvnQ5MnV6Fq1npuckwYFQ@mail.gmail.com>
On Wed, Oct 08, 2014 at 01:22:33PM +0200, Richard Hartmann wrote:
Show 7 quoted lines
> 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...

I have seen similar problems where various git commands fail in the middle if a config file is the subject of merge conflicts. For example:

  vauxhall ok % git pull . master
  From .
   * branch            master     -> FETCH_HEAD
  Auto-merging .zshrc
  CONFLICT (content): Merge conflict in .zshrc
  Auto-merging .zshenv
  CONFLICT (content): Merge conflict in .zshenv
  Auto-merging .vimrc
  Auto-merging .gitconfig
  CONFLICT (content): Merge conflict in .gitconfig
  fatal: bad config file line 9 in .gitconfig

This tends to be one of the downsides of storing one's dotfiles in git. I usually work around it by specifying HOME=/tmp before a command I think might cause a conflict in .gitconfig. I'm not sure there's any good way around it, though.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Tanay Abhra
Message 5 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.