Subject: bug#23769: 25.0.95; Mode Line breakage in vc-git

From: Dmitry Gutov <[email-masked]>
Date: Thu, 16 Jun 2016 00:02:12 +0300

On 06/15/2016 11:48 PM, Phillip Lord wrote:

> I've noticed from instrumenting vc-git that it's not just the
> symbolic-ref command that returns 128, but several others. So, it might
> be that the best long term solution would be to make change vc-git--call
> to set the default directory to the root, which would make GIT_DIR=.git
> always correct.

The patch looks wrong. Why does the problem script set GIT_DIR to '.git'?

In all examples I've found, this variable is set to an absolute value. 
In general, its purpose, it seems, is to point to the '.git' directory 
when it's named otherwise and/or is situated somewhere outside of the 
current directory tree.

The latter situation will break vc-git-root. As such, the submitted 
patch is only likely to work in the tautological case you've descried. 
And it will add some performance penalty to each call, because 
vc-git-root, though usually fast, is not free.

> At the moment, though, I've noticed some git commands are called with
> simple file names, and some full, so this would probably require more
> changes.

Indeed.