|
From: | Dmitry Gutov |
Subject: | Re: Git conflict VC state detection |
Date: | Sun, 10 Nov 2013 23:26:35 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 10.11.2013 22:30, Óscar Fuentes wrote:
I've revised the initial commit implementing conflict state detection on my private branch and the problem with it was that it didn't detect edited state on a staged file, i.e. a file containing staged (but uncommitted) changes would show as up to date. So I pursued a more precise method. The problem is that the git commands that tells you that a file is unmerged doesn't tell that a file contains changes if those are staged.
Are you sure? AFAICS, 'git diff' behaves this way ('git diff' shows only unstages changes, 'git diff --cached' only stages ones, but 'git diff HEAD' will include both), but the 'git diff-index' command we're using already includes HEAD as the reference, and even if I do a 'git add' on some edited file, while 'git diff' shows me nothing, 'git diff-index --raw HEAD' includes the file with status M.
I haven't tested it in the situation with a file being merged, though. Maybe that's different somehow.
I CC'ed Dmitry as he implemented the part that my patch touches. I'll like to get the ok from him before installing the patch,
I did a relatively small change there, actually, it just unwrapped all the code in `vc-git-registered'. But FWIW, I don't like the idea of doing double the work (external process calls) to know about one more status, in principle.
[Prev in Thread] | Current Thread | [Next in Thread] |