unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] emacs-25 e55d0db: Fix revision calculation in vc-git-mode-line-string
       [not found] ` <E1avHst-0007zE-3Z@vcs.savannah.gnu.org>
@ 2016-04-27  9:40   ` Dmitry Gutov
  2016-04-27 14:23     ` Leo Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2016-04-27  9:40 UTC (permalink / raw)
  To: emacs-devel, Leo Liu

On 04/27/2016 08:19 AM, Leo Liu wrote:
> branch: emacs-25
> commit e55d0db95700edd11e71660729566c67b6c563b3
> Author: Leo Liu <sdl.web@gmail.com>
> Commit: Leo Liu <sdl.web@gmail.com>
>
>     Fix revision calculation in vc-git-mode-line-string
>
>     * lisp/vc/vc-git.el (vc-git-mode-line-string): Use
>       vc-git-working-revision because vc-working-revision needs to decide
>       the backend and may return nil.

Why was that bad?

vc-working-revision also caches the result, and vc-git-working-revision 
does not. Do you want Emacs to call Git multiple times per second?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] emacs-25 e55d0db: Fix revision calculation in vc-git-mode-line-string
  2016-04-27  9:40   ` [Emacs-diffs] emacs-25 e55d0db: Fix revision calculation in vc-git-mode-line-string Dmitry Gutov
@ 2016-04-27 14:23     ` Leo Liu
  2016-04-27 14:55       ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Liu @ 2016-04-27 14:23 UTC (permalink / raw)
  To: emacs-devel

On 2016-04-27 12:40 +0300, Dmitry Gutov wrote:
> Why was that bad?
>
> vc-working-revision also caches the result, and
> vc-git-working-revision does not. Do you want Emacs to call Git
> multiple times per second?

Thanks, I hadn't paid attention to the cache issue. I pushed a different
fix that doesn't bypass the cache.

We need to avoid deciding the backend at that point and
vc-git-mode-line-string expects REV to be non-nil or the substring form
will complain.

Leo




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] emacs-25 e55d0db: Fix revision calculation in vc-git-mode-line-string
  2016-04-27 14:23     ` Leo Liu
@ 2016-04-27 14:55       ` Dmitry Gutov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Gutov @ 2016-04-27 14:55 UTC (permalink / raw)
  To: Leo Liu, emacs-devel

On 04/27/2016 05:23 PM, Leo Liu wrote:

> We need to avoid deciding the backend at that point and
> vc-git-mode-line-string expects REV to be non-nil or the substring form
> will complain.

..........
..........
..........

Oh, you mean when the HEAD is in detached mode? I see.

The current version looks fine, thanks.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-27 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20160427051934.30651.96563@vcs.savannah.gnu.org>
     [not found] ` <E1avHst-0007zE-3Z@vcs.savannah.gnu.org>
2016-04-27  9:40   ` [Emacs-diffs] emacs-25 e55d0db: Fix revision calculation in vc-git-mode-line-string Dmitry Gutov
2016-04-27 14:23     ` Leo Liu
2016-04-27 14:55       ` Dmitry Gutov

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).