From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#23769: 25.0.95; Mode Line breakage in vc-git Date: Thu, 16 Jun 2016 14:25:19 +0300 Message-ID: <36d92078-759f-94bd-d381-20d7727c9c85@yandex.ru> 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> <87vb19zilb.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1466076412 5761 80.91.229.3 (16 Jun 2016 11:26:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2016 11:26:52 +0000 (UTC) Cc: 23769@debbugs.gnu.org To: Phillip Lord Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 16 13:26:41 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 1bDVRZ-0001sh-2x for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 13:26:41 +0200 Original-Received: from localhost ([::1]:48445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDVRY-0000QT-5T for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 07:26:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDVRA-0000B7-HJ for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 07:26:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDVQw-0000z1-08 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 07:26:16 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDVQv-0000yt-Tp for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 07:26:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bDVQv-00078m-Q3 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 07:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2016 11:26: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.146607633027404 (code B ref 23769); Thu, 16 Jun 2016 11:26:01 +0000 Original-Received: (at 23769) by debbugs.gnu.org; 16 Jun 2016 11:25:30 +0000 Original-Received: from localhost ([127.0.0.1]:42946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDVQP-00077w-Pz for submit@debbugs.gnu.org; Thu, 16 Jun 2016 07:25:29 -0400 Original-Received: from mail-wm0-f42.google.com ([74.125.82.42]:34651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDVQO-00077j-Da for 23769@debbugs.gnu.org; Thu, 16 Jun 2016 07:25:28 -0400 Original-Received: by mail-wm0-f42.google.com with SMTP id k184so31557974wme.1 for <23769@debbugs.gnu.org>; Thu, 16 Jun 2016 04:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=CMpOe0BTU4zorq7uy2Xl9V8IEX0KfpTRENrguiofs0c=; b=fIk58wUfBwjJKY/2aYLAn43GU0sn0P75tMSCPB0to5vloZZmbIolw3G7TpZKv2fvkM TXEKYpexTAsrGm3ftgY/9ogYdddAi8OM3xOhRl6fJnCQJ4XhVaoQ9M4BVNnRsGMzFc33 9GKX1WuLIRkPAI1it3u0JjELP7MGDp4VB6IZoAZkgXhvuax7IQJ8IHyCLe5dhG67Vae7 2UaECEv3NXy4FBwGh/7P5fnVU+Ico5mRNXi8X97N5ddjJfBHoryvA7btvSj4EGJgLSZc cBKgoQur7XsAQ6ddB4jZqdrDv1hM/lahuwNQrNCo9e/m9WCnKtW6swIXFt8uLuIpU8Ye C92A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=CMpOe0BTU4zorq7uy2Xl9V8IEX0KfpTRENrguiofs0c=; b=RGkyxILSgZAYJM68G9leeCUSaYGAusdX7yEKM/o2f5k8Fkcuhn9VRhHIhFPX6gDBGr C6Xa2ulSf0zCiRe36BSiEJOTXfbm/CuzCCktdEcVW3RU4Udf1xQfMBYu4TF1c9GctUOs y5BxLSp9z5D7XDhmqnoIpIUJ6rT0M/AhbMieWEKMgUrH8/23413D7U/4TEi/ca8PkLAd AT1Iiyy/GPH9gBbnEFLoW2zjzqcBMRyswkUy4cjSK5WyhZLkLuqoZxP0neyCGzUwwCDe kJ+0iyyToMBGI2s0khd1QcbC8jUgjyld7v01SDX8UGz/OCnwF55ek9sAyVrVi+Cevb5t ANMw== X-Gm-Message-State: ALyK8tJe//oUyfLie+mnYMLUA3P0aX15Hzmrxh+qc1pM4R/rnywtVK6pkHkG6MnQzO1IAw== X-Received: by 10.194.119.233 with SMTP id kx9mr52516wjb.87.1466076322424; Thu, 16 Jun 2016 04:25:22 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.173.135]) by smtp.googlemail.com with ESMTPSA id r16sm3297801wmb.23.2016.06.16.04.25.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jun 2016 04:25:21 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 In-Reply-To: <87vb19zilb.fsf@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:119622 Archived-At: On 06/16/2016 10:41 AM, Phillip Lord wrote: > 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. Well, maybe it's used internally. It's of no concern to us here. > 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. It shouldn't. But it should let the user know that something's going wrong, so they can file a bug report. > 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. How come? It'll be about as short as your current patch, if not shorter. > 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. Let's not be hasty about it. If new arguments arise in favor of this, we can do it, but so far unsetting GIT_DIR seems like the cheapest option. Like this: diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f35c84d..4e495a5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1450,7 +1450,9 @@ vc-git--call (or coding-system-for-read vc-git-log-output-coding-system)) (coding-system-for-write (or coding-system-for-write vc-git-commits-coding-system)) - (process-environment (cons "PAGER=" process-environment))) + (process-environment (cons + "GIT_DIR=" + (cons "PAGER=" process-environment)))) (apply 'process-file vc-git-program nil buffer nil command args))) (defun vc-git--out-ok (command &rest args)