all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* vc-git doesn't select current revision in vc-print-log
@ 2007-10-13 12:48 Chris Moore
  2007-10-13 17:29 ` Dan Nicolaescu
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Moore @ 2007-10-13 12:48 UTC (permalink / raw)
  To: emacs-pretest-bug

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.

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

* Re: vc-git doesn't select current revision in vc-print-log
  2007-10-13 12:48 vc-git doesn't select current revision in vc-print-log Chris Moore
@ 2007-10-13 17:29 ` Dan Nicolaescu
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Nicolaescu @ 2007-10-13 17:29 UTC (permalink / raw)
  To: Chris Moore; +Cc: emacs-pretest-bug

"Chris Moore" <christopher.ian.moore@gmail.com> writes:

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

That won't be correct, it ignores the rev argument. 

If you want to work on this please talk to the vc-git author.  I have
talked to him about this issue and he was thinking about a
solution...

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

end of thread, other threads:[~2007-10-13 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-13 12:48 vc-git doesn't select current revision in vc-print-log Chris Moore
2007-10-13 17:29 ` Dan Nicolaescu

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.