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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52172 in the body.
You can then email your comments to 52172 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 29 Nov 2021 01:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Justin Schell <justinmschell <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 29 Nov 2021 01:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Justin Schell <justinmschell <at> gmail.com>
To: "Andrea Corallo via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: 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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 29 Nov 2021 14:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Justin Schell <justinmschell <at> gmail.com>
Cc: 52172 <at> debbugs.gnu.org, Dmitry Antipov <dmantipov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 29 Nov 2021 15:47:22 +0100
Justin Schell <justinmschell <at> gmail.com> writes:

> `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,

I think this approach makes the most sense, but perhaps Dmitry has an
opinion here (added to the CCs).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 03 Dec 2021 01:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 00:58:02 GMT) Full text and rfc822 format available.

Message #13 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Justin Schell <justinmschell <at> gmail.com>
Cc: 52172 <at> debbugs.gnu.org, Dmitry Antipov <dmantipov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 6 Dec 2021 03:57:00 +0300
Hi Lars!

On 29.11.2021 17:47, Lars Ingebrigtsen wrote:
> Justin Schell<justinmschell <at> gmail.com>  writes:
> 
>> `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,
> I think this approach makes the most sense, but perhaps Dmitry has an
> opinion here (added to the CCs).

Looks good to me (especially with included tests). The 
trailing-dot-stripping approach, that is.

I would even suggest to try to get it into emacs-28 (given that 
apparently that functionality has been broken in macOS for a long time).

But then again, if it's only been reported now, maybe it's not hugely 
important and Emacs 28 can live without it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 01:00:02 GMT) Full text and rfc822 format available.

Message #16 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Justin Schell <justinmschell <at> gmail.com>
Cc: 52172 <at> debbugs.gnu.org, Dmitry Antipov <dmantipov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 6 Dec 2021 03:58:24 +0300
On 29.11.2021 17:47, Lars Ingebrigtsen wrote:
> perhaps Dmitry has an
> opinion here

BTW, that was the email of a different Dmitry. ;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 01:03:02 GMT) Full text and rfc822 format available.

Message #19 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 52172 <at> debbugs.gnu.org, Justin Schell <justinmschell <at> gmail.com>,
 Dmitry Antipov <dmantipov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 06 Dec 2021 02:02:04 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 29.11.2021 17:47, Lars Ingebrigtsen wrote:
>> perhaps Dmitry has an
>> opinion here
>
> BTW, that was the email of a different Dmitry. ;-)

Oops!  I blame ecomplete!

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 01:31:02 GMT) Full text and rfc822 format available.

Message #22 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 52172 <at> debbugs.gnu.org, Justin Schell <justinmschell <at> gmail.com>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 06 Dec 2021 02:29:52 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Looks good to me (especially with included tests). The
> trailing-dot-stripping approach, that is.

OK; I've now pushed it to Emacs 29.

> I would even suggest to try to get it into emacs-28 (given that
> apparently that functionality has been broken in macOS for a long
> time).
>
> But then again, if it's only been reported now, maybe it's not hugely
> important and Emacs 28 can live without it.

This sort of change can be somewhat ticklish, as it depends on output
from external programs, and it's hard to get full test coverage of that.
So I'd rather just put it on master.

Justin, this change was small enough to apply without assigning
copyright to the FSF, but for future patches you want to submit, it
might make sense to get the paperwork started now, so that subsequent
patches can be applied speedily. Would you be willing to sign such
paperwork?





bug marked as fixed in version 29.1, send any further explanations to 52172 <at> debbugs.gnu.org and Justin Schell <justinmschell <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 06 Dec 2021 01:31:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 01:45:02 GMT) Full text and rfc822 format available.

Message #27 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Justin Schell <justinmschell <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52172 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Sun, 5 Dec 2021 17:44:19 -0800
> Justin, this change was small enough to apply without assigning
> copyright to the FSF, but for future patches you want to submit, it
> might make sense to get the paperwork started now, so that subsequent
> patches can be applied speedily. Would you be willing to sign such
> paperwork?

Sure thing. Will you email them to me or is there a URL I should visit?

Justin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52172; Package emacs. (Mon, 06 Dec 2021 01:53:01 GMT) Full text and rfc822 format available.

Message #30 received at 52172 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Justin Schell <justinmschell <at> gmail.com>
Cc: 52172 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#52172: Fix vc-git--program-version to support Git for macOS
 version string
Date: Mon, 06 Dec 2021 02:52:14 +0100
Justin Schell <justinmschell <at> gmail.com> writes:

> Sure thing. Will you email them to me or is there a URL I should visit?

Great; here's the form to get started:


Please email the following information to assign <at> gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Jan 2022 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 75 days ago.

Previous Next


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