GNU bug report logs -
#51316
29.0.50; Should we match the final ".git" in bug-reference autosetup?
Previous Next
Reported by: miha <at> kamnitnik.top
Date: Thu, 21 Oct 2021 12:15:02 UTC
Severity: wishlist
Tags: moreinfo
Found in version 29.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #15 received at 51316 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> 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.
Thanks.
>> 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.
Oh, right, that seems to work just fine. I only checked the URLs you
get with the "copy to clipboard" buttons the forges provide.
>> 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\\)?\\'"
Indeed.
> 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.)
No, in my experience there cannot be anything after ".git". At least
it's the last part of the filename and I doubt you can have query
parameters like https://forge.org/user/project.git?foo=bar in a git url.
> This is a feature request, in any case, so it should go to Emacs 29, I
> think.
I would kindly ask to reconsider. This complete bug-reference
auto-setup thingy is new in emacs 28, the forge setup code is even just
a month old, and using your improved regexp doesn't seem risky at all
and might provide a much better user experience to possibly a lot of
users, my vote would be to fix this in emacs-28.
Bye,
Tassilo
This bug report was last modified 3 years and 201 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.