From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Brubeck Unhammer Newsgroups: gmane.emacs.bugs Subject: bug#18788: 24.4; vc-git-working-revision vs mode-line gives error Date: Sat, 31 Jan 2015 14:09:45 +0100 Message-ID: <87twz7hzae.fsf@mm.st> References: <87wq7sfqtt.fsf@fsfe.org> <86zjaqo52x.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1422709816 31118 80.91.229.3 (31 Jan 2015 13:10:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Jan 2015 13:10:16 +0000 (UTC) Cc: 18788@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 31 14:10:15 2015 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 1YHXoQ-0004rC-Vr for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Jan 2015 14:10:11 +0100 Original-Received: from localhost ([::1]:41582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHXoQ-0001Q9-6Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Jan 2015 08:10:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHXoL-0001NS-UN for bug-gnu-emacs@gnu.org; Sat, 31 Jan 2015 08:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHXoI-0007pk-PK for bug-gnu-emacs@gnu.org; Sat, 31 Jan 2015 08:10:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHXoI-0007pP-LX for bug-gnu-emacs@gnu.org; Sat, 31 Jan 2015 08:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YHXoI-0006jm-5m for bug-gnu-emacs@gnu.org; Sat, 31 Jan 2015 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Brubeck Unhammer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Jan 2015 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18788 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18788-submit@debbugs.gnu.org id=B18788.142270979525877 (code B ref 18788); Sat, 31 Jan 2015 13:10:02 +0000 Original-Received: (at 18788) by debbugs.gnu.org; 31 Jan 2015 13:09:55 +0000 Original-Received: from localhost ([127.0.0.1]:58692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YHXoA-0006jJ-Ov for submit@debbugs.gnu.org; Sat, 31 Jan 2015 08:09:55 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53232) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YHXo8-0006jA-Ax for 18788@debbugs.gnu.org; Sat, 31 Jan 2015 08:09:53 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 05D3F2069B; Sat, 31 Jan 2015 08:09:52 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sat, 31 Jan 2015 08:09:52 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=svwjJH8Ied+mhRaLwn3RMa86rdg=; b=ZXxopwOXLfRKeVJdz0qI 3lxnWeRQHIJFdgPIVC9w/TORKbdCFdhvlGKfudvgFOTM4/wTE5r7eZMTu+tP3lo6 dg+9G9d4v2Y+lECIMAT/Mq3wC65IvjwGBYYBjhS7CMe/DqxxwON7x0MlN03qUg29 jFt4YJKbvJlFhPX8rr3sFnA= X-Sasl-enc: S6IWRlLL/9GgtGYpj8I/Ipkg8R5TWamPXT5B9WHWAcYU 1422709791 Original-Received: from kiwiarch (unknown [84.210.14.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 5BCF5C0028B; Sat, 31 Jan 2015 08:09:51 -0500 (EST) In-Reply-To: <86zjaqo52x.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 14 Dec 2014 13:15:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98933 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I had this bug pop up again, after having been away for many months. Dmitry Gutov writes: > Kevin Brubeck Unhammer writes: > >> Whenever I try to save a git-registered file under emacs 24.4, I get >> >> apply: Args out of range: #("Git@" 0 4 (help-echo "Locally added >> file under the Git version control system")), 0, 7 > > I don't see that. > > Does that happen in a bare session (started with `emacs -Q')? > > Is there anything special about the repository, or its current local stat= e? The repo I've seen it with under ~ if that makes any difference (ie. ~/.git) =E2=80=93 I can't remember if I've seen it other places. >> The function vc-git-mode-line-string tries to get the revision using >> vc-working-revision, which returns nil. Instead of checking the `rev' >> variable for nil, it checks `detached', before calling substring. It >> should probably do >> >> (if (and detached rev) >> (substring =E2=80=A6)=20 >> =E2=80=A6) >> >> instead. I don't know why vc-working-revision returns nil though >> (there's a whole lot of indirection to dig through there). > > Does (vc-git-working-revision buffer-file-name) return nil in the same bu= ffer? Yes. I followed the calls a bit more this time and (vc-git--out-ok "rev-parse" "HEAD") also gives nil, while (apply 'vc-git--call '(t nil) "rev-parse" "HEAD") gives 128; this is the return value of (apply 'process-file "git" nil '(t nil) nil "rev-parse" '("HEAD")) When I keep stderr by doing (apply 'process-file "git" nil '(t nil) nil "rev-parse" '("HEAD")) I get fatal: Not a git repository: .git Notably, this only happens with files that are in subdirectories of ~ (but still tracked by the ~ repo), not with files that are directly inside ~. E.g. it happens with ~/org/gtd.org, but not with ~/.gitignore. Also, I've never seen that exact error message from git before. I've seen fatal: Not a git repository (or any of the parent directories): .git and fatal: Not a git repository (or any parent up to mount point /tmp) but only from this emacs bug have I seen the no-parenthesis fatal: Not a git repository: .git When I restarted emacs to see if it had anything to do with my init.el, the bug was gone again. =2D-=20 Kevin Brubeck Unhammer GPG: 0x766AC60C --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUzNQZAAoJEHQmBt52asYMzmQIAL2zrp7PfVG73x68S5aeSGwT 1J2jkArvlSe3AZxzt9/hmUNkkWjzeClRWrymtaQjoCKuIkP5PBpW8B+FUARdu389 aXRXgic1cVEt5DR6SPGaSD4BxMPsctmJ0KZ/c4CLa4Sl/jRnEFQpeUCPAPKJDf4R KTduGRp+rD0ktXssUxC7B3cyQvSIM3H8n8OqlWlNdRYwGHt+q/ea/5kW5gO33uMY utngf8X7Be2TKMXIr5LuCyR3UezxJ4uXtx3/j6yJyrUmLRk/Q/aa5/Jd/lideu0g 1wHD1QBV9V+5Nx+C+MH3XW4vPDWvKLmu6N2QfpXPHHZpH35sBrI0cXApNCHUIpg= =F0RV -----END PGP SIGNATURE----- --=-=-=--