|
From: | Dmitry Gutov |
Subject: | Re: [PATCH] Fix vc-working-revision return nil when default-directory is not inside repo |
Date: | Mon, 18 May 2020 03:05:57 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 17.05.2020 17:17, Ilya Ostapyshyn wrote:
Despite the complex scenario I described, the issue is not hard to reproduce. 1. Open a file in a Git repository 2. (vc-working-revision buffer-file-name) => working revision hash 3. (cd "/") 4. (vc-file-clearprops buffer-file-name) ;; clear the cached revision in symbol's props 5. (vc-working-revision buffer-file-name) => nil
OK, thank you for the examples. Indeed, the behavior is not well-defined, so let's fix it, especially considering the performance difference is negligible.
I've pushed a fix to master, a slightly different version of your patch. This will be in Emacs 28.
Regarding doing it in another place, that would be inside vc-git-working-revision. Maybe we'll switch to that approach later, given that neither Hg not Bzr seem to have exhibited the same problem.
But I went with the "safer" option now.
[Prev in Thread] | Current Thread | [Next in Thread] |