From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: vc-git-show-log-entry Date: Mon, 20 Oct 2008 02:36:58 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224501601 12971 80.91.229.12 (20 Oct 2008 11:20:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2008 11:20:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 20 13:20:45 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KrrDc-0006yU-Df for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2008 11:38:32 +0200 Original-Received: from localhost ([127.0.0.1]:36101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KrrCX-00077w-3o for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2008 05:37:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KrrCR-00077X-55 for emacs-devel@gnu.org; Mon, 20 Oct 2008 05:37:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KrrCP-00077I-Mn for emacs-devel@gnu.org; Mon, 20 Oct 2008 05:37:18 -0400 Original-Received: from [199.232.76.173] (port=41979 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KrrCP-00077F-Gc for emacs-devel@gnu.org; Mon, 20 Oct 2008 05:37:17 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:60396 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KrrCP-0004dy-44 for emacs-devel@gnu.org; Mon, 20 Oct 2008 05:37:17 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KrrCF-00075Z-RU for emacs-devel@gnu.org; Mon, 20 Oct 2008 09:37:07 +0000 Original-Received: from roar.cs.berkeley.edu ([128.32.36.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Oct 2008 09:37:07 +0000 Original-Received: from quarl by roar.cs.berkeley.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Oct 2008 09:37:07 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: roar.cs.berkeley.edu X-Quack-Archive: 1 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:/9RCzO8f23w84TIY7OSnvu7M65Q= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104651 Archived-At: Hi, In Emacs 22.2.1, visiting a git-versioned file, when I do `vc-print-log', point always moves to the end of the buffer instead of the beginning. This worked for me: (defun vc-git-rev-parse (commit) "Translate COMMIT string into full SHA1 object name. Returns nil if not possible." (and commit (with-temp-buffer (and (zerop (call-process "git" nil '(t nil) nil "rev-parse" "--verify" commit)) (goto-char (point-min)) (= (forward-line 2) 1) (bolp) (buffer-substring-no-properties (point-min) (1- (point-max))))))) (defun vc-git-show-log-entry (rev) (log-view-goto-rev (vc-git-rev-parse rev))) I looked at CVS HEAD and noticed a new vc-git-show-log-entry and some recent modifications. I believe the vc-git.el:1.72 version would do the right thing for my use case, but I suspect the r1.73 change: * vc-git.el (vc-git-show-log-entry): Include the revision in the search string. breaks it. It looks like that function was supposed to parse things like "HEAD~5", "HEAD^^" into a search repeat count, but the 1.73 change changed the intention of the search. Personally, I like the vc-git-rev-parse solution better. It handles every method of specifying commits, the "git way". vc-git-rev-parse can be refactored with vc-git-symbolic-commit, on which it's based. Karl