[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Jonathan Ganc
Subject: bug#26066: 26.0.50; vc-git-status gives wrong result
Date: Thu, 13 Apr 2017 20:42:42 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

First, I'm sorry for this delayed response. I've had a busy few days (and I needed to think about the issue)!

I'm fine with decoupling the question about default-directory from the patch for git status. I have attached a patch that does not bind default-directory. (And I now have turned in the assignment paperwork to the FSF!).

I continue to think that binding default-directory in vc-git-state makes the most sense.

If vc-git supports calling vc-git-state from outside of the repository, but not some other commands, or if vc-git-state does but some other backends' vc-xx-state does not, this will increase inconsistency and make it harder for the programmers to write VCS-agnostic code, which is one of the main goals of VC.

But being vcs-agnostic is more for people who use vc-state or vc-state-refresh, rather than people actually writing the vc-specific functions, no? If this bug is unchanged, people using vc-state have to ask themselves: "if the backend is git, I have to bind default-directory but if it's not, I don't." That is inconsistent with vc agnosticism.

Is it necessary for correct output in other backends, in similar scenarios?

I agree that fixing this makes sense, but it should be done in an organized fashion

That's a valid question and a valid point. But I actually think that adding the binding in vc-git-state furthers the goal of systematically answering them. I doubt we'll be able to find, at one time, people with knowledge of more than 4 or 5 of the vc's (e.g. I know only git) who have the time to address this issue. What we can do instead, though, is to encourage people to properly write the backend specific functions. If, at some point, we notice that every vc-BACKEND-state binds default-directory, then we can move the binding to vc-state.

However, this question reinforces my opinion that binding default-directory can be treated satisfactorily as a backend-specific question. The fact that I can't argue in general that an arbitrary vc system needs default-directory set suggests to me that one should leave it to the vc system to decide. For example, I could imagine a backend that wants the current directory to be the root directory of the repository, rather than the directory containing the file.

Attachment: 0001-update-vc-git.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]