GNU bug report logs - #52172
Fix vc-git--program-version to support Git for macOS version string

Previous Next

Package: emacs;

Reported by: Justin Schell <justinmschell <at> gmail.com>

Date: Mon, 29 Nov 2021 01:45:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

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: Justin Schell <justinmschell <at> gmail.com>
To: 52172 <at> debbugs.gnu.org
Subject: bug#52172: Fix vc-git--program-version to support Git for macOS version string
Date: Sun, 28 Nov 2021 18:44:21 -0700
[Message part 1 (text/plain, inline)]
The current `vc-git.el` `vc-git--program-version` function doesn't
support the version string returned by Git on macOS. `git version` on
macOS returns e.g., "git version 2.30.1 (Apple Git-130)" and
`vc-git--program-version` currently returns "0" instead of "2.30.1".

I've attached patches for two options for a fix.

`topic.fix-vc-git--program-version.ignore-trailing.patch` updates the
regexp used to match numeric version strings that are a combination of
digits and dots (starting with a digit), ignoring anything else that
comes after. Any trailing dots are then stripped. This is more general
than the current approach of supporting a numeric version string only,
or a numeric version string followed by the specific additional
strings that some Git versions append (currently only the additional
string appended by Git for Windows is supported) and supports
reasonable version strings that I can think of that potential other
versions of Git might return. I'm unaware of why this approach wasn't
used in the previous fix used for Git for Windows support. As such,
I've also attached `topic.fix-vc-git--program-version.support-macos`,
which adds to the current approach, adding support for the specific
additional string that Git for macOS returns, if that is preferred.

Also included are unit tests for each approach.

Thanks,
Justin Schell
[topic.fix-vc-git--program-version.ignore-trailing.patch (application/octet-stream, attachment)]
[topic.fix-vc-git--program-version.support-macos (application/octet-stream, attachment)]

This bug report was last modified 3 years and 247 days ago.

Previous Next


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