git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Crabtree, Andrew" <andrew.crabtree@hpe.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Inconsistent results from git rev-parse --show-toplevel
Date: Fri, 14 Feb 2020 01:36:49 -0500	[thread overview]
Message-ID: <20200214063649.GD605125@coredump.intra.peff.net> (raw)
In-Reply-To: <TU4PR8401MB111777B793EA9C3D5336CE26F9040@TU4PR8401MB1117.NAMPRD84.PROD.OUTLOOK.COM>

On Thu, Jan 30, 2020 at 09:59:31PM +0000, Crabtree, Andrew wrote:

> > > But the bigger thing, I think, is: who is setting GIT_DIR but not
> > > setting GIT_WORK_TREE to match? Because IMHO that's the situation
> > > that is causing the confusion.
> 
> > but it fails a test in t5601 around git-clone. 
> 
> Thanks jeff.  It looks like this might have been tried previously and
> abandoned?  I'm pretty far out of my league here in terms of how
> things are supposed to operate and any history around the previous
> attempts at making it work.
> [...]
> commit d95138e695d99d32dcad528a2a7974f434c51e79

Yeah, the commit you found was doing exactly the thing I suggested. IMHO
the right path forward is to actually fix the weirdness in git-clone. It
would be a backwards incompatibility, but a pretty obscure one. I think
we're likely to help more people than hurt by being able to handle
$GIT_WORK_TREE consistently. At least that's my gut feeling.

I guess one way to fix it without breaking compatibility would be for us
to set $GIT_WORK_TREE alongside $GIT_DIR, but _also_ set a special
$GIT_CLONE_NO_RESPECT_WORK_TREE variable that would instruct it that the
caller isn't trying to do trigger the special $GIT_WORK_TREE behavior.

But we'd have to carry that hack around forever, which doesn't excite
me.

-Peff

      reply	other threads:[~2020-02-14  6:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 18:07 Inconsistent results from git rev-parse --show-toplevel Crabtree, Andrew
2020-01-24 19:59 ` Junio C Hamano
2020-01-25 19:31   ` Crabtree, Andrew
2020-01-25 19:53     ` Jeff King
2020-01-25 22:22       ` Crabtree, Andrew
2020-01-30 10:29         ` Jeff King
2020-01-30 21:59           ` Crabtree, Andrew
2020-02-14  6:36             ` Jeff King [this message]

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=20200214063649.GD605125@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=andrew.crabtree@hpe.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).