git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Øystein Walle" <oystwa@gmail.com>
To: git@vger.kernel.org
Subject: Re: git stash doesn't honor --work-tree or GIT_WORK_TREE
Date: Sat, 30 Nov 2013 21:22:01 +0000 (UTC)	[thread overview]
Message-ID: <loom.20131130T221443-682@post.gmane.org> (raw)
In-Reply-To: CABL6xpD9jvJWjUj0n+mgC419fGzA2N-b_yJho9zharCD6YTSiw@mail.gmail.com

Aaron Brooks <aaron <at> 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
> git-rev-parse).
> 
> Having looked through several of the other git-*.sh scripts, I think
> other shell based git commands will have similar problems.
> 
> Thanks,
> 
> Aaron
> 

The environment variables are properly exported. I verified this by
adding 'echo $GIT_WORK_TREE; echo $GIT_DIR' at the top of git-stash.sh.
So these should propagate to "child gits" just fine, and so it shouldn't
be necessary to test them explicitly.

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.

In the mean time, if you are able to use Git 1.8.5, `git -C test-repo
stash` will work just fine.

Øsse

  reply	other threads:[~2013-11-30 21:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30 19:04 git stash doesn't honor --work-tree or GIT_WORK_TREE Aaron Brooks
2013-11-30 21:22 ` Øystein Walle [this message]
2013-12-01 11:12   ` Thomas Rast
2013-12-01 11:50     ` Duy Nguyen
2013-12-01 15:50       ` Thomas Rast
2013-12-02 18:01         ` Junio C Hamano
2013-12-01 19:12       ` Øystein Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20131130T221443-682@post.gmane.org \
    --to=oystwa@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).