From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#51316: 29.0.50; Should we match the final ".git" in bug-reference autosetup? Date: Fri, 22 Oct 2021 22:45:23 +0200 Message-ID: <87wnm49345.fsf@gnu.org> References: <87ilxqbmg7.fsf@miha-pc> <87sfwtcdg5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19094"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.3; emacs 29.0.50 Cc: miha@kamnitnik.top, 51316@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 22 23:12:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1me1pi-0004oI-9E for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Oct 2021 23:12:10 +0200 Original-Received: from localhost ([::1]:58826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1me1ph-0003mX-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Oct 2021 17:12:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1me1pa-0003mO-Ot for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 17:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1me1pa-00023J-Fq for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 17:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1me1pa-0007V3-B8 for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 17:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Oct 2021 21:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 51316-submit@debbugs.gnu.org id=B51316.163493709828800 (code B ref 51316); Fri, 22 Oct 2021 21:12:02 +0000 Original-Received: (at 51316) by debbugs.gnu.org; 22 Oct 2021 21:11:38 +0000 Original-Received: from localhost ([127.0.0.1]:33865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me1pC-0007US-HQ for submit@debbugs.gnu.org; Fri, 22 Oct 2021 17:11:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me1p7-0007UB-Dp for 51316@debbugs.gnu.org; Fri, 22 Oct 2021 17:11:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35508) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1me1p1-0000FU-GL; Fri, 22 Oct 2021 17:11:27 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:42947) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1me1p1-0008LL-Df; Fri, 22 Oct 2021 17:11:27 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 24BD227C0054; Fri, 22 Oct 2021 17:11:27 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 22 Oct 2021 17:11:27 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvkedgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe fhfeejheefleeflefgjeekieehkefhuedtieelleeuueettdduffevgedufeetffenucff ohhmrghinhepghhithhlrggsrdgtohhmpdhfohhrghgvrdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhp rghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsug hhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Oct 2021 17:11:25 -0400 (EDT) In-reply-to: <87sfwtcdg5.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217912 Archived-At: Lars Ingebrigtsen 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