From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 503121F45E for ; Fri, 14 Feb 2020 06:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728783AbgBNGgu (ORCPT ); Fri, 14 Feb 2020 01:36:50 -0500 Received: from cloud.peff.net ([104.130.231.41]:43190 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725840AbgBNGgu (ORCPT ); Fri, 14 Feb 2020 01:36:50 -0500 Received: (qmail 19233 invoked by uid 109); 14 Feb 2020 06:36:50 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Fri, 14 Feb 2020 06:36:50 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 19311 invoked by uid 111); 14 Feb 2020 06:45:46 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 14 Feb 2020 01:45:46 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 14 Feb 2020 01:36:49 -0500 From: Jeff King To: "Crabtree, Andrew" Cc: Junio C Hamano , "git@vger.kernel.org" Subject: Re: Inconsistent results from git rev-parse --show-toplevel Message-ID: <20200214063649.GD605125@coredump.intra.peff.net> References: <20200125195319.GA5519@coredump.intra.peff.net> <20200130102933.GE840531@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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