GNU bug report logs - #18788
24.4; vc-git-working-revision vs mode-line gives error

Previous Next

Package: emacs;

Reported by: Kevin Brubeck Unhammer <unhammer <at> fsfe.org>

Date: Wed, 22 Oct 2014 08:33:01 UTC

Severity: normal

Tags: moreinfo

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kevin Brubeck Unhammer <unhammer <at> fsfe.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 18788 <at> debbugs.gnu.org
Subject: bug#18788: 24.4; vc-git-working-revision vs mode-line gives error
Date: Sat, 31 Jan 2015 14:09:45 +0100
[Message part 1 (text/plain, inline)]
I had this bug pop up again, after having been away for many months.

Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Kevin Brubeck Unhammer <unhammer <at> fsfe.org> 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 state?

The repo I've seen it with under ~ if that makes any difference (ie.
~/.git) – 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 …) 
>>      …)
>>
>> 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 buffer?

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.



-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 9 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.