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: Thu, 16 Jun 2016 08:41:20 +0100 Message-ID: <87vb19zilb.fsf@russet.org.uk> References: <87a8ioyq9o.fsf@russet.org.uk> <87wplr1z4z.fsf@russet.org.uk> <91e61a46-b3bb-c4d9-cb30-bbfa90135d69@yandex.ru> <877fdqkwki.fsf@russet.org.uk> <9856a1e4-be41-d781-bfbd-22bac360d18b@yandex.ru> <871t3y85oz.fsf@russet.org.uk> <6b6f147e-3b42-ccf5-92fd-0890d6942d4b@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466062951 19561 80.91.229.3 (16 Jun 2016 07:42:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2016 07:42:31 +0000 (UTC) Cc: 23769@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 16 09:42:19 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 1bDRwR-0005ic-3P for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 09:42:19 +0200 Original-Received: from localhost ([::1]:47062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRwQ-0000OG-7D for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 03:42:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRwG-0000LT-ML for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 03:42:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDRwA-0005Vr-K9 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 03:42:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDRwA-0005Vh-GK for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 03:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bDRwA-0001dp-66 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 03:42:02 -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: Thu, 16 Jun 2016 07:42:02 +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.14660628896270 (code B ref 23769); Thu, 16 Jun 2016 07:42:02 +0000 Original-Received: (at 23769) by debbugs.gnu.org; 16 Jun 2016 07:41:29 +0000 Original-Received: from localhost ([127.0.0.1]:42861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDRvc-0001d4-Qn for submit@debbugs.gnu.org; Thu, 16 Jun 2016 03:41:28 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:37111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDRva-0001cs-UB for 23769@debbugs.gnu.org; Thu, 16 Jun 2016 03:41:27 -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=mXKQ+UO1OaK94fOW40AtVeVF8i8DOD58mqiNSuAqXsA=; b=K3L9bsuJzmNdi2Wp4o3vFfMV/s iAEtinAV+oS7TG0YqC3duoAlb/pfGF89D3ZyM4LFSj+yXUPW9BeQJHCskPuLpaeCa5JEeC+bmOuZW oioYD88+GurgsMlbE83Evx7f3LTCyYl1lZFXKpMFMPhUp5okKvpCYoBu4K/bD0ov3Xv+upqjTcagR Ep9oYvQdj7/V7q49+8/KNxzn5cQewBFMT5Qt9RVv5LNygfl9xfGiUgMt/7t24EkrGmX8TNSUH7rd/ voJ+YZjONYzWGjY2EGCuJf5CjwMHo6F5jBYKTWdKn7Iy9MrQC7ImTfbHGdf1jxylvFCN3bD60SAwr C/z+Ognw==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:46760 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bDRvV-0006tL-3j; Thu, 16 Jun 2016 08:41:21 +0100 In-Reply-To: <6b6f147e-3b42-ccf5-92fd-0890d6942d4b@yandex.ru> (Dmitry Gutov's message of "Thu, 16 Jun 2016 02:25:43 +0300") 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:119619 Archived-At: Dmitry Gutov writes: > On 06/16/2016 01:09 AM, Phillip Lord wrote: >> That situation does indeed happen. For example, I normally checkout >> emacs into worktrees where you get this when commiting on emacs-25 >> branch which is a worktree off master. > > Does git-worktree use GIT_DIR in some way? Well, it uses the directory that GIT_DIR points to (so master/.git/worktrees/emacs-25 contains COMMIT_MSG, HEAD, index and so on). Whether is uses GIT_DIR, who knows. I pressume that all git commands obey GIT_DIR. >> There is a simpler option. I am trying to solve the root cause of the >> problem but, as you say, that might be fraught. Since the problem only >> seems to cause an error with vc-git-mode-line-string, we could just >> discard the error from vc-git-working-revision in this case. > > That sounds like a last-resort option. It's certainly true that it would nice to fix it elsewhere, but I am unconvinced that setting the mode-line should ever result in an error as a normal part of it's operation. >> Failing that, now I know what the problem is, at least I have a >> workaround (unset GIT_DIR in the pre-commit hook). > > We could also unset GIT_DIR locally inside vc-git--call. At least when > it's set to a known value such as '.git'. Yep; I guess, we know exactly what vc-git--call does with git, and if it never depends on GIT_DIR that should work. Although setting and unsetting GIT_DIR seems a bit of a pain. Personally, I prefer my first option of calling git consistently -- always with CWD equal to root, and always with file paths relative to the root. This way, GIT_DIR should not matter. I presume the vc.el facade allows this, but if so, as this is going onto master now, there is time. Phil