bug#2982: 23.0.92; `vc-diff' behaves inconsistently with git

Stefan Monnier <[email protected]>
Newsgroups gmane.emacs.bugs,gmane.emacs.pretest.bugs
Message-ID <[email protected]>
> although, as before, a.txt is unchanged. In a new Emacs instance,
> "C-x v =" again behaves like the first time. git version: 1.6.2.

VC tries to avoid running the backend for "vc-diff" when the file is
unchanged, by keeping track of the file's modtime when the backend (in
this case, git) tells VC that the file is up-to-date.

So when you open the file, Emacs asks `git' the status of the file and
so knows that this modtime corresponds to "up-to-date".  After `touch',
OTOH, Emacs isn't so sure any more, so it runs `git diff' which happens
to output "diff --git a/a.txt b/a.txt".  IIRC if "git diff" didn't
output anything at all, the *vc-diff* window would not be made visible
and VC would have also indicated "No changes between working revision
and workfile", but since "git diff" did output something, VC presumes
that there is some kind of difference (without trying to understand the
actual content of that process output).


        Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.