Subject: Re: bug#51316: 29.0.50; Should we match the final ".git" in bug-reference autosetup?

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 22 Oct 2021 16:59:54 +0200

[email-masked] writes:

> If function 'bug-reference--build-forge-setup-entry':
>
>> `(,(concat "[/@]" host-domain "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git")
> This should be "(regexp-quote host-domain)".

This is now fixed in Emacs 28.

> Also, it would be nice if the final "\\.git" wasn't mandatory.  I often
> git clone a website url as displayed in a web browser
> ("https://gitlab.com/rstocker/emacs-bluetooth" for example) without
> appending ".git".  Git has no problem fetching from such an url (tested
> with github, gitlab and gitea), but bug-reference autosetup machinery
> fails to detect it as a valid url.
>
> Unfortunately, we can't simply change the final .git into
> "\\(?:\\.git\\)?" because regexp greediness would then swallow it into
> the first match group.

This would work, though:

"[/:]\\([.A-Za-z0-9_/-]+?\\)\\(?:\\.git\\)?\\'"

But requires that the string doesn't have anything after the .git,
whereas it's currently more sloppy.  I'm not sure whether that's by
intent or not.  (So I'm adding Tassilo to the CCs.)

This is a feature request, in any case, so it should go to Emacs 29, I
think.

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