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 #21 received at 51316 <at> debbugs.gnu.org (full text, mbox):
<miha <at> kamnitnik.top> writes:
>>> 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.
>>
> I tried "git clone https://gitlab.com/rstocker/emacs-bluetooth.git/"
> and it worked, so we should probably allow ".git/" with a final slash
> as well.
Ah, good catch, that's obviously correct since .git it is a directory.
> And then I also tried "git clone
> https://gitlab.com/rstocker/emacs-bluetooth.git//" and it also worked,
> so I guess any number of slashes are allowed after the final ".git".
I've also tried, and it seems the maximum number of trailing slashes is
two. Those all work:
https://github.com/djcb/mu
https://github.com/djcb/mu/
https://github.com/djcb/mu//
https://github.com/djcb/mu.git
https://github.com/djcb/mu.git/
https://github.com/djcb/mu.git//
but any more / gives me "Not found". Well, and I guess even the two-/
will most probably never occur in real-life when considering where the
URL comes from. I mean, those are usually copy-and-pasted from the
forge's special "clone me" button or from a browser's URL bar.
> Therefore I propose something like this:
>
> "[/:]\\([.A-Za-z0-9_/-]+?\\)\\(?:\\.git/*\\)?\\'"
With the reasoning above, I'd suggest using
"[/:]\\([.A-Za-z0-9_/-]+?\\)\\(?:\\.git/?\\)?\\'"
Bye,
Tassilo
This bug report was last modified 3 years and 202 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.