Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: brian m. carlson <hidden>
Date: 2016-06-15 23:02:40

On Wed, Oct 08, 2014 at 01:22:33PM +0200, Richard Hartmann wrote:
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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help