GNU bug report logs -
#5344
23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables
Previous Next
Full log
View this message in rfc822 format
>>>>> On Sun, 01 Dec 2019 11:53:01 +0100, Gregor Zattler <grfz <at> gmx.de> said:
Gregor> Hi Lars,
Gregor> sorry for the delay.
Gregor> * Lars Ingebrigtsen <larsi <at> gnus.org> [2019-11-24; 22:46]:
>> Gregor Zattler <grfz <at> gmx.de> writes:
>>> Actually git does it the other way around: It uses the values of
>>> the environment variables even if there is a .git directory
>>> further up in the file system hierarchy. So it's not a fall
>>> back but it overrides the default.
>>
>> The vc functions in Emacs sets GIT_DIR to "" before calling git, so in
>> vc mode it would be a fallback.
Gregor> I don't have much clue but perhaps this is the wrong thing to do?
Itʼs the right thing to do in the context of vc, where it only
supports the directory-based model of repository. Setting GIT_DIR to
"" avoids having the environment of the shell where you started emacs
messing up VC.
>> It seems like providing a simple alist of directories/git repos would do
>> the trick in vc-dir, wouldn't it?
No. Define a variable that will be used by vc to override what it
thinks the current repository is, and then use .dir-locals.el to set
it per-directory. Patches welcome :-)
Robert
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.