unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Uwe Brauer <oub@mat.ucm.es>, 59257@debbugs.gnu.org
Subject: bug#59257: 29.0.50;vc-git-mode-line-string out of range
Date: Tue, 15 Nov 2022 08:28:51 +0100	[thread overview]
Message-ID: <87pmdo65ho.fsf@mat.ucm.es> (raw)
In-Reply-To: <87h6z16xo8.fsf@mat.ucm.es>

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> It seems like `vc-git--symbolic-ref' returns nil when it shouldn't?

> I think the attached patch will stop the backtrace from happening, but
> it's more of a workaround:

Thanks, I will test it and report back if you find anything strange. 

Since I only use git very occasionally I have no idea 
why this error pops up and what it means.




> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index a1ff03144b..ae3cada3d7 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -391,7 +391,7 @@ vc-git-mode-line-string
>    "Return a string for `vc-mode-line' to put in the mode line for FILE."
>    (let* ((rev (vc-working-revision file 'Git))
>           (disp-rev (or (vc-git--symbolic-ref file)
> -                       (and rev (substring rev 0 7))))
> +                       (and rev (string-limit rev 7))))
>           (def-ml (vc-default-mode-line-string 'Git file))
>           (help-echo (get-text-property 0 'help-echo def-ml))
>           (face   (get-text-property 0 'face def-ml)))

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

      reply	other threads:[~2022-11-15  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 21:20 bug#59257: 29.0.50;vc-git-mode-line-string out of range Uwe Brauer
2022-11-15  3:09 ` Stefan Kangas
2022-11-15  7:28   ` Uwe Brauer [this message]

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=87pmdo65ho.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=59257@debbugs.gnu.org \
    --cc=stefankangas@gmail.com \
    /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).