From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5344: 23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables Date: Sat, 23 Nov 2019 14:03:33 +0100 Message-ID: <87imnaoica.fsf@gnus.org> References: <20100109014953.GC25574@shi.workgroup> <201001091929.o09JT9QF010981@godzilla.ics.uci.edu> <20100110223940.GB4845@shi.workgroup> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="26919"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 5344@debbugs.gnu.org To: Gregor Zattler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 23 14:04:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iYV5H-0006rp-DJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Nov 2019 14:04:19 +0100 Original-Received: from localhost ([::1]:58770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYV5E-0002oC-JH for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Nov 2019 08:04:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYV56-0002ne-Cs for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2019 08:04:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYV54-00046d-Da for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2019 08:04:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47120) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iYV53-00046W-VJ for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2019 08:04:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iYV51-0008S1-3n for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2019 08:04:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Nov 2019 13:04:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5344 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 5344-submit@debbugs.gnu.org id=B5344.157451424232466 (code B ref 5344); Sat, 23 Nov 2019 13:04:03 +0000 Original-Received: (at 5344) by debbugs.gnu.org; 23 Nov 2019 13:04:02 +0000 Original-Received: from localhost ([127.0.0.1]:55938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYV4u-0008RU-4R for submit@debbugs.gnu.org; Sat, 23 Nov 2019 08:04:01 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:35688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYV4h-0008Qv-1q for 5344@debbugs.gnu.org; Sat, 23 Nov 2019 08:03:49 -0500 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iYV4Y-0005Uw-3U; Sat, 23 Nov 2019 14:03:36 +0100 In-Reply-To: <20100110223940.GB4845@shi.workgroup> (Gregor Zattler's message of "Sun, 10 Jan 2010 23:39:40 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172289 Archived-At: Gregor Zattler writes: > (defun vc-git-root (file) > - (vc-find-root file ".git")) > +(if (getenv "GIT_DIR") > + (getenv "GIT_WORK_TREE") > + (vc-find-root file ".git"))) As far as I can tell by skimming vc-git.el, functionality like this has not been added during the intervening years. The use case it: > I use bare git repositories for version contol of some dotfiles.[1] This > means that the repository ist *not* in a .git directory which is part of > the working directorys hirarchy. Instead the environment variable > GIT_DIR indicates the location of the repository and the environment > variable GIT_WORK_TREE indicates the working directory. We wouldn't want to add this in the form suggested above, but it does sound like a useful feature, if I understand it correctly. But I don't quite see how you'd tie a specific location to a specific GIT_DIR value, so I don't see how this would work in general. Perhaps fall back on GIT_DIR/GIR_WORK_TREE if vc-git-root returns nil would be reasonable? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no