emacs-devel
[Top][All Lists]
Advanced

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

vc-git doesn't select current revision in vc-print-log


From: Chris Moore
Subject: vc-git doesn't select current revision in vc-print-log
Date: Sat, 13 Oct 2007 14:48:43 +0200

Using "C-x v l" to show a file's revision history is supposed to
select the current version in the log, but for git-controlled files it
leaves point at the end.

This is because (log-view-goto-rev rev) is called with REV bound to a
branch name ("master", or whatever), but log-view-goto-rev can only
match on the SHA1 hashes.

It turns out that the current revision is always the first one in the
list, since vc-print-log lists from the currently selected version
backwards, so adding the following to vc-git.el fixes the problem:

(defun vc-git-show-log-entry (rev)
  (goto-char (point-min))
  (log-view-msg-next))

I also noticed that reloading vc-git.el isn't enough to get VC to
notice the new function.  vc-arch.el has this in it:

;; Clear up the cache to force vc-call to check again and discover
;; new functions when we reload this file.
(put 'Arch 'vc-functions nil)

perhaps vc-git.el would benefit from the same (with 'Git instead of
'Arch, of course).

Chris.




reply via email to

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