GNU bug report logs - #5657
`vc-git-annotate-extract-revision-at-line' returns incorrect pathname

Previous Next

Package: emacs;

Reported by: Štěpán Němec <stepnem <at> gmail.com>

Date: Sun, 28 Feb 2010 15:00:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5657 in the body.
You can then email your comments to 5657 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5657; Package emacs. (Sun, 28 Feb 2010 15:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Štěpán Němec <stepnem <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 28 Feb 2010 15:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Štěpán Němec <stepnem <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: `vc-git-annotate-extract-revision-at-line' returns incorrect pathname
Date: Sun, 28 Feb 2010 15:57:58 +0100
Hello,

I spotted this when running `vc-annotate-show-diff-revision-at-line', which
called the above-mentioned fuction in this case.

Incorrect path is returned when not called from the repository root, because
the value of `default-directory' (used by `expand-file-name') will be
different (i.e. the current directory deeper in the tree, instead of the
root dir).

The patch below (based on the latest Git master) fixes it.

Regards,

 Štěpán Němec

       
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -668,7 +668,9 @@ or BRANCH^ (where \"^\" can be repeated)."
    (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
      (let ((revision (match-string-no-properties 1)))
	(if (match-beginning 2)
-	  (cons revision (expand-file-name (match-string-no-properties 3)))
+	  (cons revision (expand-file-name
+                          (match-string-no-properties 3)
+                          (vc-git-root default-directory)))
	  revision)))))

;;; TAG SYSTEM





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5657; Package emacs. (Sun, 07 Mar 2010 14:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 5657 <at> debbugs.gnu.org (full text, mbox):

From: stepnem <at> gmail.com (Štěpán Němec)
To: 5657 <at> debbugs.gnu.org
Date: Sun, 07 Mar 2010 15:19:17 +0100
PING
[Any reason not to act on this?]




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5657; Package emacs. (Sun, 07 Mar 2010 14:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 5657 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: stepnem <at> gmail.com
Cc: 5657 <at> debbugs.gnu.org
Subject: Re: bug#5657:
Date: Sun, 07 Mar 2010 09:46:03 -0500
stepnem <at> gmail.com "(Štěpán Němec)" writes:

> PING
> [Any reason not to act on this?]

I've just checked it in.  Thanks.




bug closed, send any further explanations to Štěpán Němec <stepnem <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sun, 07 Mar 2010 14:47:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Apr 2010 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.