From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23769: 25.0.95; Mode Line breakage in vc-git Date: Tue, 14 Jun 2016 22:30:27 +0100 Message-ID: <87shwf1mrw.fsf@russet.org.uk> References: <87a8ioyq9o.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1465940022 23760 80.91.229.3 (14 Jun 2016 21:33:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jun 2016 21:33:42 +0000 (UTC) Cc: 23769@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 14 23:33:27 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bCvxa-0001NR-Te for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Jun 2016 23:33:23 +0200 Original-Received: from localhost ([::1]:38301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCvxX-0000Jx-0X for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Jun 2016 17:33:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCvvO-00071x-6A for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2016 17:31:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCvvJ-0006pz-Vz for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2016 17:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCvvJ-0006pm-TE for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2016 17:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bCvvJ-0006Ac-ME for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2016 17:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2016 21:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23769 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23769-submit@debbugs.gnu.org id=B23769.146593983723688 (code B ref 23769); Tue, 14 Jun 2016 21:31:01 +0000 Original-Received: (at 23769) by debbugs.gnu.org; 14 Jun 2016 21:30:37 +0000 Original-Received: from localhost ([127.0.0.1]:40905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCvuv-0006A0-FN for submit@debbugs.gnu.org; Tue, 14 Jun 2016 17:30:37 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:59879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCvut-00069m-2R for 23769@debbugs.gnu.org; Tue, 14 Jun 2016 17:30:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=2RG1exvlZmltjaSrCUrmh6w74RQkrXvr72apTC5p1gM=; b=J84muIIAbxmlZgPM2AfJD06IrZ 6hM1oPAbZb8JNiR5X+NotZgD84v9NnrqildWo1nODYTt5uhTXlv7+/TvdEUZDpHrZ0qkSI0YbY1iJ 9rsT/tDzMghs+zOE0I+6EetNgZkkjp1BSzqN5njkTlTnOLvP6ZMv2SJzAogVeLHgcgWWq6gKzORwo lIyKicvimcOUGXg+R+OmSOKIHtPbBmLLOzrzEKAZaMzMwbfDEPni7Aqlu4g+3WDKKljVUsXMb8fwZ wYcDhoi9IksMNJ2nf20cu7hOgVkOF3qwkFGkCGGIZt6U22WhnyhWJA/iMI+XniI/UyeEd0u9Mhd3R MBCVs/JA==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:60190 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bCvum-003382-Ug; Tue, 14 Jun 2016 22:30:29 +0100 In-Reply-To: (Glenn Morris's message of "Tue, 14 Jun 2016 12:29:04 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119556 Archived-At: Glenn Morris writes: > AFAIK Emacs doesn't support GIT_DIR, see eg https://debbugs.gnu.org/5344 . I think I have tracked the cause of the problem. It happens if a test opens a file in a subdirectory of the git root. When the file is opened Emacs checks to see whether the file is versioned. Somewhere down the line Emacs calls vc-git-working-revision, which eventually results in invocation of `git symbolic-ref HEAD`. All is good. Unless, GIT_DIR is set to ".git". Now, `git symbolic-ref HEAD` fails in subdirectories because GIT_DIR is still set to .git, when the .git directory is in the root. git symbolic-ref fails with 128 "Fatal: Not a git repository". Unfortunately, this is exactly the situation on a pre-commit hook. Git changes working directory to the root of the git repository, and then sets GIT_DIR to be .git. Potential solutions: 1) Ignore return values from git (fail silently) 2) Unset GIT_DIR (but I don't know why it is set by git, and I assume it is for some reason) 3) Run all vc-git commands from the root dir, and use fully qualified names. Will think further. Phil