all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jonathan H <pythonnut@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 21383-done@debbugs.gnu.org
Subject: bug#21383: Static revisions in vc-working-revision
Date: Wed, 2 Sep 2015 15:44:01 -0700	[thread overview]
Message-ID: <CAAW2-Zd662pvfVGK169a-DuBbAX2UhMkKt6ov51hxqg3CCVWRg@mail.gmail.com> (raw)
In-Reply-To: <55E6D426.10105@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2199 bytes --]

Something seems a bit amiss with the current patch.

I'm using (vc-working-revision buffer-file-name (vc-responsible-backend
buffer-file-name)) to determine the current working revision.

As far as I can tell, vc-working-revision will cache the current working
revision in a file property, but it doesn't know when to invalidate the
cache, so the results can be stale. In fact, in the specific case of git,
you probably can't get any faster than a rev-parse anyway, so caching
doesn't make much sense.

I have a sneaking suspicion that git isn't the only backend where this can
happen.

Thanks,
Jonathan



On Wed, Sep 2, 2015 at 3:49 AM, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 09/02/2015 06:50 AM, Stefan Monnier wrote:
>
>> Maybe you see it better.  I only imagined the problem limited to the
>>> non-file-granularity backends.
>>>
>>
>> You mean like most current backends? ;-)
>>
>
> Yes. But as long as its only limited to the backends (and can be fixed
> there), as opposed to being inherently present in vc.el, log-edit.el, etc,
> it's less of a problem.
>
> And we can't simply remove the FILE argument in many backend commands: it's
>>> often used for vc-file-get/setprop.
>>>
>>
>> I know.
>>
>> In any case, it's not that bad: it works.  But there's something fishy
>> that will surely bite at some point.  Maybe those FILE args should be
>> redefined to be relative to default-directory (and can't use things like
>> "../..").
>>
>
> vc-file-setprop won't work on a relative path. Or shouldn't, at least.
>
> And are you talking about FILE arg to vc-status, or e.g. vc-git-status? If
> vc-status requires the path to be relative, that will complicate the
> consumer interface (now I have to worry about producing the relative path).
> If vc-status will be responsible for that before calling vc-git-status, it
> won't work in file-granular backends. Anyway, why would we want that extra
> call, even if it's cached?
>
> And vc-git-working-revision won't care if FILE is absolute or relative,
> which is the crux of the problem. I'd rather backends like Git, if we're
> going to fix this, used FILE's parent directory to change default-directory
> temporarily before calling Git.
>

[-- Attachment #2: Type: text/html, Size: 3256 bytes --]

  reply	other threads:[~2015-09-02 22:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31  0:45 bug#21383: Static revisions in vc-working-revision Jonathan H
2015-08-31  4:45 ` Stefan Monnier
2015-08-31  8:47   ` Dmitry Gutov
2015-08-31 17:44     ` Stefan Monnier
2015-09-01  2:11       ` Dmitry Gutov
2015-09-01  3:55         ` Stefan Monnier
2015-09-01 12:05           ` Dmitry Gutov
2015-09-01 15:45             ` Stefan Monnier
2015-09-01 15:54               ` Dmitry Gutov
2015-09-01 16:52                 ` Stefan Monnier
2015-09-01 17:23                   ` Dmitry Gutov
2015-09-02  3:50                     ` Stefan Monnier
2015-09-02 10:49                       ` Dmitry Gutov
2015-09-02 22:44                         ` Jonathan H [this message]
2015-09-03 12:56                           ` Dmitry Gutov
2015-09-03 16:17                             ` Stefan Monnier
2015-09-03 17:34                               ` Jonathan H
2015-09-03 18:40                                 ` Dmitry Gutov
2015-09-03 20:07                                   ` Stefan Monnier
2015-09-03 22:32                                     ` Dmitry Gutov
2015-09-04 14:36                                       ` Stefan Monnier
2015-09-05  2:30                                         ` Dmitry Gutov
2015-09-03 16:04                         ` Stefan Monnier
2015-09-03 19:24                           ` Dmitry Gutov
2015-09-04  2:20                             ` Stefan Monnier
2015-09-05  3:08                               ` Dmitry Gutov
2015-09-05 15:12                                 ` Stefan Monnier
2015-09-05 20:30                                   ` Dmitry Gutov
2015-09-06 22:29                                     ` Stefan Monnier
2015-09-07 20:55                                       ` Using different default-directory and relative paths in VC, Was: Re: bug#21383 Dmitry Gutov
2015-09-07 22:33                                         ` Stefan Monnier
2015-09-07 23:29                                           ` Dmitry Gutov
2015-09-07 23:34                                             ` Dmitry Gutov
2015-09-08  1:31                                             ` Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAW2-Zd662pvfVGK169a-DuBbAX2UhMkKt6ov51hxqg3CCVWRg@mail.gmail.com \
    --to=pythonnut@gmail.com \
    --cc=21383-done@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.