Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-12-02 Thread Junio C Hamano
Thomas Rast writes: > The problem here is that shell scripts that want to do something with a > worktree tend to call require_work_tree in git-sh-setup: > > require_work_tree () { > test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || > die "fatal: $0 cannot be used wit

Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-12-01 Thread Øystein Walle
Duy Nguyen gmail.com> writes: > It should. At the beginning of cmd_rev_parse(), setup_git_directory() > is called, which will check and follow all GIT_* or their command line > equivalent. I'll look into this some time later. I think I was wrong and rev-parse --is-inside-work-tree *does* honor t

Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-12-01 Thread Thomas Rast
Duy Nguyen writes: > On Sun, Dec 1, 2013 at 6:12 PM, Thomas Rast wrote: >> Øystein Walle writes: >>> The problem seems to be that git rev-parse --is-inside-work-tree does >>> not honor these. In fact it doesn't even honor --git-dir or --work-tree. >>> Judging by the name this may be intentional

Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-12-01 Thread Duy Nguyen
On Sun, Dec 1, 2013 at 6:12 PM, Thomas Rast wrote: > Øystein Walle writes: >> The problem seems to be that git rev-parse --is-inside-work-tree does >> not honor these. In fact it doesn't even honor --git-dir or --work-tree. >> Judging by the name this may be intentional. > > Thanks for investigat

Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-12-01 Thread Thomas Rast
Øystein Walle writes: > Aaron Brooks brooks1.net> writes: > >> Unlike other commands, git stash doesn't work outside of the worktree, >> even when --work-tree is specified: [...] > The environment variables are properly exported. I verified this by > adding 'echo $GIT_WORK_TREE; echo $GIT_DIR' a

Re: git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-11-30 Thread Øystein Walle
Aaron Brooks brooks1.net> writes: > > Unlike other commands, git stash doesn't work outside of the worktree, > even when --work-tree is specified: > > (...) > > It looks like the "require_work_tree" function should check the > environment variables in addition to the status of the PWD (via > g

git stash doesn't honor --work-tree or GIT_WORK_TREE

2013-11-30 Thread Aaron Brooks
Unlike other commands, git stash doesn't work outside of the worktree, even when --work-tree is specified: abrooks@host:~/tmp$ mkdir test-repo abrooks@host:~/tmp$ cd !$ cd test-repo abrooks@host:~/tmp/test-repo$ git init Initialized empty Git repository in /home/abrooks/tmp/test-repo/.git/ abrooks