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
Hi Dan,
* Dan Nicolaescu <dann <at> ics.uci.edu> [09. Jan. 2010]:
> Gregor Zattler <grfz <at> gmx.de> writes:
> > 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. But in emacs/vc
> > these dotfiles do not show up as version controlled, even when the emacs
> > session inherited the correct GIT_* environment variables:
> >
> > ~$ export GIT_DIR=~/.fgits/emacs.git
> > ~$ export GIT_WORK_TREE="$GIT_DIR/$(git config --get core.worktree)"
> > ~$ printenv|grep GIT
> > GIT_DIR=/home/grfz/.fgits/emacs.git
> > GIT_WORK_TREE=/home/grfz/.fgits/emacs.git/../../
>
> If you want to add support for this, it's quite likely that the only
> thing that needs to be changed is the vc-git-root in
> emacs/lisp/vc-git.el.
Sorry I'm not capable to do this. That's the reason I called it
a wish list bug.
Because of your suggestion I have fiddled around a bit and found
a workaround which somehow supports your suggestion::
I initilalised an empty repository ~/.git. Now vc "considers"
my whole home directory as potentially version controlled and
interacts with git. Git in turn honours the environment
variables and voila: many of the vc-commands are working now.
Since I do not want to use this ~/.git I did a
chmod -R a-w ~/.git
in order to prevent accidentially using this repository in stead
of one of the detached ones.
Thanks for the hint.
Gregor
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.