all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Štěpán Němec" <stepnem@gmail.com>
To: 5657@debbugs.gnu.org
Subject: bug#5657: `vc-git-annotate-extract-revision-at-line' returns incorrect pathname
Date: Sun, 28 Feb 2010 15:57:58 +0100	[thread overview]
Message-ID: <20100228145758.GB16169@headley> (raw)

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







             reply	other threads:[~2010-02-28 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28 14:57 Štěpán Němec [this message]
     [not found] ` <87hbosxli2.fsf@gmail.com>
2010-03-07 14:46   ` bug#5657: Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100228145758.GB16169@headley \
    --to=stepnem@gmail.com \
    --cc=5657@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.