From: Kevin Brubeck Unhammer <unhammer@fsfe.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 18788@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 [thread overview]
Message-ID: <87twz7hzae.fsf@mm.st> (raw)
In-Reply-To: <86zjaqo52x.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 14 Dec 2014 13:15:18 +0200")
[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]
I had this bug pop up again, after having been away for many months.
Dmitry Gutov <dgutov@yandex.ru> writes:
> Kevin Brubeck Unhammer <unhammer@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
next prev parent reply other threads:[~2015-01-31 13:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 8:31 bug#18788: 24.4; vc-git-working-revision vs mode-line gives error Kevin Brubeck Unhammer
2014-12-14 11:15 ` Dmitry Gutov
2014-12-15 9:50 ` Kevin Brubeck Unhammer
2015-01-31 13:09 ` Kevin Brubeck Unhammer [this message]
2015-02-02 13:10 ` Dmitry Gutov
2015-02-02 13:53 ` Kevin Brubeck Unhammer
2015-12-26 16:22 ` Lars Ingebrigtsen
2015-12-27 8:15 ` Kevin Brubeck Unhammer
2015-02-11 6:08 ` nil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87twz7hzae.fsf@mm.st \
--to=unhammer@fsfe.org \
--cc=18788@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).