Subject: bug#26066: 26.0.50; vc-git-status gives wrong result

From: Jonathan Ganc <[email-masked]>
Date: Wed, 15 Mar 2017 22:40:40 -0400

First of all, I realized that the let binding needs to surround the 
entire vc-git-state function, not just (vc-git--empty-db-p) (because 
vc-git--run-command-string, vc-git--call have the same issue with 
default-directory). E.g., change

(let ((diff (vc-git--run-command-string
                file "diff-index" "-p" "--raw" "-z" "HEAD" "--")))

to

(let* ((default-directory (file-name-directory file))
        (diff (vc-git--run-command-string
              file "diff-index" "-p" "--raw" "-z" "HEAD" "--")))

But yes, I will work on an improved version using git status and try 
incorporate/improve on vc-git-conflicted-files.

(My ultimate goal is to try to get something like atom's status for git 
files into emacs, which is how I noticed the problem to begin with).

On 03/15/2017 08:48 PM, Dmitry Gutov wrote:
> On 16.03.2017 02:42, [email-masked] wrote:
>> As an aside, is there a reason that vc-git-status does not use "git
>> status -z --porcelain --ignored"? It seems more natural/straightfoward
>> and it would also deal with ignored and removed files. It could also
>> work with directories, which the current function doesn't.
>
> Like mentioned in a discussion on a different bug, we'll accept a 
> patch like that. You can even reuse some code from 
> `vc-git-conflicted-files`.