From: Dmitry Gutov <dgutov@yandex.ru>
To: Ilya Ostapyshyn <ilya.ostapyshyn@gmail.com>
Cc: emacs-devel@gnu.org
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 [thread overview]
Message-ID: <23ccbb54-b768-e586-22df-9277c6251c7b@yandex.ru> (raw)
In-Reply-To: <m2h7weir2e.fsf@ilya-mbp.lan>
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 parent reply other threads:[~2020-05-18 0:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-17 11:16 [PATCH] Fix vc-working-revision return nil when default-directory is not inside repo Ilya Ostapyshyn
2020-05-17 13:01 ` Dmitry Gutov
2020-05-17 13:49 ` Ilya Ostapyshyn
2020-05-17 14:17 ` Ilya Ostapyshyn
2020-05-18 0:05 ` Dmitry Gutov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23ccbb54-b768-e586-22df-9277c6251c7b@yandex.ru \
--to=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=ilya.ostapyshyn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).