From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#5657: `vc-git-annotate-extract-revision-at-line' returns incorrect pathname Date: Sun, 28 Feb 2010 15:57:58 +0100 Message-ID: <20100228145758.GB16169@headley> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1267370712 30395 80.91.229.12 (28 Feb 2010 15:25:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2010 15:25:12 +0000 (UTC) To: 5657@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 28 16:25:05 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nll0y-0008I8-TN for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Feb 2010 16:25:05 +0100 Original-Received: from localhost ([127.0.0.1]:49754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nll0y-0000LP-4f for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Feb 2010 10:25:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlkzS-0008P6-Rn for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 10:23:30 -0500 Original-Received: from [140.186.70.92] (port=42336 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlkzR-0008OR-CN for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 10:23:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NlkzQ-0006WM-Ey for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 10:23:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52602) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlkzQ-0006WH-Cr for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 10:23:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Nlkcm-0003Db-7O; Sun, 28 Feb 2010 10:00:04 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Feb 2010 15:00:03 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5657 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.126736917712339 (code B ref -1); Sun, 28 Feb 2010 15:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Feb 2010 14:59:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlkcL-0003Cy-6L for submit@debbugs.gnu.org; Sun, 28 Feb 2010 09:59:37 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nlkad-0003Bb-LF for submit@debbugs.gnu.org; Sun, 28 Feb 2010 09:57:52 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]:60989) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlkaY-0008Uo-Or for submit@debbugs.gnu.org; Sun, 28 Feb 2010 09:57:46 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NlkaX-0006tA-Em for submit@debbugs.gnu.org; Sun, 28 Feb 2010 09:57:46 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:46512) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NlkaX-0006t4-AI for submit@debbugs.gnu.org; Sun, 28 Feb 2010 09:57:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlkaW-0005Cy-Lk for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 09:57:44 -0500 Original-Received: from [140.186.70.92] (port=58931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlkaV-0005Ca-N9 for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 09:57:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NlkaV-0003sU-Pj for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 09:57:44 -0500 Original-Received: from mail-fx0-f222.google.com ([209.85.220.222]:35755) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlkaV-0003sN-LE for bug-gnu-emacs@gnu.org; Sun, 28 Feb 2010 09:57:43 -0500 Original-Received: by fxm22 with SMTP id 22so1659497fxm.26 for ; Sun, 28 Feb 2010 06:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:content-transfer-encoding:user-agent; bh=rYqQLIPRhIdflIMbzefpj93aMQAF5hoQsHIQFr6C7Mk=; b=ubgOG61P+mYcoCc9a8f33t2JAlZF3akT0U1McuwajDfybAtQyZg0KErRHh2jZbDIvt FBljsyzLHF/uT5aqVzejYhi/UXZLPwOPDnbTPfKJbCMx2aYCGlAGcjyrBrEShEvZvzUt LEQNv3ebCn+VspEWz9I92+f49ZVaOrPR4DbIs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:content-transfer-encoding :user-agent; b=r8mIBVoY96v+p0cxVEUM5vySvRe8jkrkkIsqQs4ABCAdQ5uN0Yvt6TXEDM0t7txZYC yfy1FZyfnyWZqonhm3aEpTuf5aD5JckUey8jkGJPJPQYgFvCw5oo7Bz5+OoknXrpKFvX NyiUp2w9JU3ICI6/C7HK59V1kyAq/ZJxeSoHU= Original-Received: by 10.223.17.155 with SMTP id s27mr3657089faa.13.1267369060905; Sun, 28 Feb 2010 06:57:40 -0800 (PST) Original-Received: from localhost ([88.103.132.186]) by mx.google.com with ESMTPS id y15sm3709856fkd.8.2010.02.28.06.57.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Feb 2010 06:57:39 -0800 (PST) Mail-Followup-To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= , bug-gnu-emacs@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-27) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Sun, 28 Feb 2010 09:59:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 28 Feb 2010 10:00:04 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35357 Archived-At: 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