Subject: 23.0.92; vc-git loses track of the current working directory
From: Daiki Ueno <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Thu, 23 Apr 2009 16:05:38 +0900

Hi,

Consider the following directory layout of a git working copy:

a
|-- .git
`-- b
    `-- c

where "c" is a file already added into the git index.

Then, go under "b", run "emacs -Q", modify "c", and M-x vc-dir.
Emacs shows:

--8<---------------cut here---------------start------------->8---
VC backend : Git
Working dir: /tmp/a/b/
Branch     : master

                         ./
                         b/
     edited              b/c

--8<---------------cut here---------------end--------------->8---

This looks weird and most of the VC commands against "b/c" fails.
For example, when I type "i" it fails with:

  error: b/b/c: does not exist and --remove not passed
  fatal: Unable to process path b/b/c

In the minibuffer:

  vc-do-command: Running git update-index --add -- b/c...FAILED (status 128)

It looks like that vc-git should chdir to the GIT_DIR before running
"git update-index", or remove "b/" from the relative path?

In GNU Emacs 23.0.92.1 (i486-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-04-12 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20090411-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
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.0.92/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.92/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: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: @im=SCIM
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  which-function-mode: t
  icomplete-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> y C-p 1 0 <return> q C-p C-p C-p C-p C-p C-p 
C-p <escape> g C-p <escape> g C-x b * t r C-g C-p <escape> 
g <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<down-mouse-1> <mouse-1> C-n <escape> g <escape> g 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p <escape> 
g C-p 1 0 <return> T S q <down-mouse-1> <mouse-1> C-a 
C-p C-p <escape> g <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> C-n C-n C-a <escape> g C-n C-n C-n C-n <escape> 
C-g C-p <escape> g C-p C-p <help-echo> <help-echo> 
<help-echo> <down-mouse-1> <mouse-1> <escape> g <escape> 
g C-p C-p C-p C-p C-p C-p C-p <escape> g <escape> g 
<escape> g <escape> g <escape> g <escape> g C-p C-p 
C-p 1 0 <return> T S C-n C-n C-n C-n C-n C-n C-n SPC 
p p q <help-echo> <down-mouse-1> <mouse-1> C-a C-p 
C-p C-p <escape> g <down-mouse-1> <mouse-1> C-n C-a 
<escape> g C-p C-p C-p C-p C-p C-p C-p C-n <escape> 
g C-p 1 0 <return> T S C-n C-n C-n C-n C-n C-n C-n 
C-n C-a SPC q <down-mouse-1> <mouse-1> C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-n <escape> g <escape> g C-p 
C-p C-p C-p C-p C-p <escape> g C-p <escape> g C-n C-n 
C-n C-n C-n C-n C-n <escape> g C-p C-p C-p <escape> 
g C-p 1 0 <return> <down-mouse-1> <mouse-1> T S q C-p 
C-p C-p C-p C-p <escape> g C-p <down-mouse-1> <mouse-1> 
C-x C-c C-g <escape> x r e p o r <tab> <return>

Recent messages:
nnimap: Updating info for nnimap:INBOX...done
Retrieving newsgroup: nntp+gmane:gmane.emacs.bugs...
Fetching headers for nntp+gmane:gmane.emacs.bugs...done
Generating summary...done
Auto-saving...
Opening nntp server on gmane...done
Auto-saving...
Garbage: 
Process imap finished
* BYE Disconnected for inactivity.
Quit

Regards,
-- 
Daiki Ueno