From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.bugs Subject: bug#5344: 23.1.91; bug/wish: vc does not honour GIT_DIR / GIT_WORK_TREE environment variables Date: Sun, 10 Jan 2010 23:39:40 +0100 Message-ID: <20100110223940.GB4845@shi.workgroup> References: <20100109014953.GC25574@shi.workgroup> <201001091929.o09JT9QF010981@godzilla.ics.uci.edu> Reply-To: Gregor Zattler , 5344@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263169175 4024 80.91.229.12 (11 Jan 2010 00:19:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jan 2010 00:19:35 +0000 (UTC) Cc: 5344@debbugs.gnu.org To: Dan Nicolaescu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 11 01:19:27 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.50) id 1NU80F-0003Wl-0k for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Jan 2010 01:19:27 +0100 Original-Received: from localhost ([127.0.0.1]:33499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU80F-00054R-DU for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 19:19:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NU7zy-0004wn-7v for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 19:19:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NU7zt-0004wF-JL for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 19:19:09 -0500 Original-Received: from [199.232.76.173] (port=38095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU7zt-0004wC-Ei for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 19:19:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54992) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NU7zt-0001DQ-80 for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 19:19:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NU7vy-0003Ev-7b; Sun, 10 Jan 2010 19:15:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Gregor Zattler , 5344@debbugs.gnu.org Resent-From: Gregor Zattler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2010 00:15:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5344 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5344-submit@debbugs.gnu.org id=B5344.126316884512422 (code B ref 5344); Mon, 11 Jan 2010 00:15:02 +0000 Original-Received: (at 5344) by debbugs.gnu.org; 11 Jan 2010 00:14:05 +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 1NU7v0-0003ED-UX for submit@debbugs.gnu.org; Sun, 10 Jan 2010 19:14:03 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1NU6Sj-00025e-Vt for 5344@debbugs.gnu.org; Sun, 10 Jan 2010 17:40:47 -0500 Original-Received: (qmail invoked by alias); 10 Jan 2010 22:40:41 -0000 Original-Received: from p57B9FEE1.dip.t-dialin.net (EHLO shi.workgroup) [87.185.254.225] by mail.gmx.net (mp051) with SMTP; 10 Jan 2010 23:40:41 +0100 X-Authenticated: #19296480 X-Provags-ID: V01U2FsdGVkX18KhfEXHBEKqQlXazhyOOUQ354wcYIEG3GxsWiyuo tI6+5gAF+vkBwn Original-Received: from grfz by shi.workgroup with local (Exim 4.71) (envelope-from ) id 1NU6S0-00030E-UY; Sun, 10 Jan 2010 23:40:00 +0100 Content-Disposition: inline In-Reply-To: <201001091929.o09JT9QF010981@godzilla.ics.uci.edu> User-Agent: Mutt/1.5.20 (2009-06-14) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57 X-Spam-Score: -3.4 (---) X-Mailman-Approved-At: Sun, 10 Jan 2010 19:14:01 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -3.3 (---) Resent-Date: Sun, 10 Jan 2010 19:15:02 -0500 X-detected-operating-system: by monty-python.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:34187 Archived-At: tags patch thanks Hi Dan, * Dan Nicolaescu [09. Jan. 2010]: > If you want to add support for this, it's quite likely that the only > thing that needs to be changed is the vc-git-root in > emacs/lisp/vc-git.el. O.K. thanks to your pointer this was really easy. I don't know if there are negative side effects or if it's a complete solution to the problem but it works for me. The patch does not normalize the resulting path, though. Don't know if this is a problem. For instance (vc-git-root "~/.emacs.d/init.el") gives me: "/home/grfz/.fgits/emacs.git/../../" I don't know if other version controll systems have similar means of detaching repository and working directory. Then vc-find-root would perhaps be a better place to patch. But thats beyond me. Thank you *very* much. Now I have to learn how to use emacsclients environment for this purpose instead of the daemon ones. Gregor --- vc-git.el 2010-01-10 22:51:23.000000000 +0100 +++ my-vc-git.el 2010-01-10 23:24:55.000000000 +0100 @@ -777,7 +777,9 @@ (defun vc-git-extra-status-menu () vc-git-extra-menu-map) (defun vc-git-root (file) - (vc-find-root file ".git")) +(if (getenv "GIT_DIR") + (getenv "GIT_WORK_TREE") + (vc-find-root file ".git"))) (defun vc-git-toggle-signoff () (interactive)