GNU bug report logs - #5344
23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables

Previous Next

Package: emacs;

Reported by: Gregor Zattler <grfz <at> gmx.de>

Date: Sat, 9 Jan 2010 01:55:02 UTC

Severity: wishlist

Full log


Message #21 received at 5344 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gregor Zattler <grfz <at> gmx.de>
Cc: 5344 <at> debbugs.gnu.org
Subject: Re: 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
Gregor Zattler <grfz <at> gmx.de> 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




This bug report was last modified 5 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.