unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: 59011@debbugs.gnu.org
Cc: Philip Kaludercic <philipk@posteo.net>
Subject: bug#59011: 29.0.50; change to vc-git-working-revision breaks vc-git-mode-line-string
Date: Fri, 04 Nov 2022 07:53:48 +0100	[thread overview]
Message-ID: <875yfvw6pv.fsf@bernoul.li> (raw)

Since 307ad210040251ea0de2e7f453350c4497bda874 `vc-git-working-revision'
may return the name of a reference (aka symbolic commit) instead of the
full sha1 hash, as it used to always do.

When that name is shorter than seven characters, then that change breaks
`vc-git-mode-line-string', which expects to be able to extract the first
seven characters of the string returned by `vc-git-working-revision'.

(By the way, it is not correct to abbreviate a commit hash to the first
N characters using (substring hash 0 N).  Even in a small repository
there is a risk that such a naive abbreviation is ambiguous.  Instead of
doing that, one should use Git to perform the abbreviation; that way one
can request an abbreviation of a certain length, and Git will comply --
unless doing that would be ambiguous, in which case it returns a longer
abbreviation.)





             reply	other threads:[~2022-11-04  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  6:53 Jonas Bernoulli [this message]
2022-11-04 16:34 ` bug#59011: 29.0.50; change to vc-git-working-revision breaks vc-git-mode-line-string Philip Kaludercic

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=875yfvw6pv.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=59011@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    /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).