unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregor Zattler <grfz@gmx.de>
To: emacs-pretest-bug@gnu.org
Cc: rfrancoise@debian.org
Subject: bug#5344: 23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables
Date: Sat, 9 Jan 2010 02:49:53 +0100	[thread overview]
Message-ID: <20100109014953.GC25574@shi.workgroup> (raw)

Dear emacs developers,

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/../../

There are several files/directories under ~/.emacs.d, but *no* .git
directory::

   ~$ ls .emacs.d/
   ~/.emacs.d$ ls -A
   _abbrev_defs      _backup  elpa         _emms-history  history
   init.el            _recentf           todo-top
   _abbrev_defs.old  _diary   _emacs.bmk   games          _ido.last
   lisp               _remember_backups  update-org.sh
   auto-save-list    elisp    _emacs_orig  _gnus
   image-dired  .org-id-locations  todo-do

There is also no ~/.git

   ~/$ ls -l ~/.git
   ls: cannot access /home/grfz/.git: No such file or directory

but git works fine:

   cd ~/.emacs.d

   ~/.emacs.d$ git status
   # On branch master
   # Changed but not updated:
   #   (use "git add <file>..." to update what will be committed)
   #   (use "git checkout -- <file>..." to discard changes in
   #   working directory)
   #
   #       modified:   init.el
   #
   no changes added to commit (use "git add" and/or "git commit -a")

Or:

   ~/.emacs.d$ git log -n 1
   commit ffa6f03211b7234533d060886614b96ea59c30f0
   Author: Gregor Zattler <telegraph@gmx.net>
   Date:   Thu Jan 7 22:38:23 2010 +0100
   
       new german aspell directory name; show max buffer size; minor
       changes
   

This are the files in ~/.emacs.d which are version controlled:

   ~/.emacs.d$ git ls-files
   _abbrev_defs
   _diary
   _gnus
   init.el

Now I start emacs:

   emacs -Q -n 

and evaluate

   (getenv "GIT_DIR")

this shows 

   "/home/grfz/.fgits/emacs.git"

in the echo area, while 

   (getenv "GIT_WORK_TREE")

gives

   "/home/grfz/.fgits/emacs.git/../../"

That's o.k.  Now I ^X f visit ~/.emacs.d/init.el but no
indication that init.el is version controlled shows up in the
mode line: 

   -UUU:----F1  init.el        Top L1     (Emacs-Lisp)----------------------------------------------------------

Now I type ^X v d (vc-dir), emacs asks 

   VC status for directory: ~/.emacs.d/

when I confirm this, I get the message

   No VC backend is responsible for /home/grfz/.emacs.d/

in the echo area.



vc does not support the specific git feature of detatched repositories.  
Therefore I file this bugreport / wishlist bug:  IMHO vc should
support this feature.  In order to do so vc should honour the
environment variables GIT_DIR and GIT_WORK_TREE respectively and
utilize the git ls-files directory.  git gives
precedence to these environment variables: even if there is a
.git directory with reository it will be ignored if the
environment variables indicate other locations for repository and
working directory.  I think vc should behave in the same way.




Thanx for your attention, 
Gregor

[1] 
These "fake bare repos" are created like this:
   export GIT_DIR=~/.fgits/emacs.git 
   git init --bare 
   git config core.bare false 
   git config core.worktree ../../ 
   git config status.showUntrackedFiles no
see http://lists.madduck.net/pipermail/vcs-home/2008-August/000175.html
for an explanation of this way of keeping dotfiles under version
control. 



If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/23.1.91/etc/DEBUG.


In GNU Emacs 23.1.91.1 (i486-pc-linux-gnu, GTK+ Version 2.18.5)
 of 2010-01-06 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20100106-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.1.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1.91/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: de_DE.utf8
  value of $LC_CTYPE: de_DE.utf8
  value of $LC_MESSAGES: POSIX
  value of $LC_MONETARY: de_DE.utf8
  value of $LC_NUMERIC: de_DE.utf8
  value of $LC_TIME: de_DE.utf8
  value of $LANG: de_DE.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
( g e t e n v SPC " G I T _ D I R " ) C-x C-e <return> 
M-x e m a <tab> b <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> r e 
p o <tab> r <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
"/home/grfz/.fgits/emacs.git"
Making completion list...

Load-path shadows:
/usr/share/emacs/23.1.91/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/23.1.91/site-lisp/emms/tq hides /usr/share/emacs/23.1.91/lisp/emacs-lisp/tq

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug help-mode easymenu view
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind font-render-setting gtk
x-toolkit x multi-tty emacs)






             reply	other threads:[~2010-01-09  1:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09  1:49 Gregor Zattler [this message]
2010-01-09 19:29 ` bug#5344: 23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables Dan Nicolaescu
2010-01-10 11:23   ` Gregor Zattler
2010-01-10 22:39   ` Gregor Zattler
2019-11-23 13:03     ` Lars Ingebrigtsen
     [not found]       ` <87wobpfnpq.fsf@len.workgroup>
2019-11-24 21:46         ` Lars Ingebrigtsen
2019-12-01 10:53           ` Gregor Zattler
2019-12-01 16:37             ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100109014953.GC25574@shi.workgroup \
    --to=grfz@gmx.de \
    --cc=5344@debbugs.gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=rfrancoise@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).