From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: RFC: Automatic setup for bug-reference-mode Date: Sun, 14 Jun 2020 22:39:52 +0200 Message-ID: <87tuzd755z.fsf@gnu.org> References: <87r1uihtsu.fsf@gnu.org> <87h7vd3cbs.fsf@gnu.org> <87tuzdsj8d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="80886"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 14 22:40:43 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jkZQo-000KwU-Db for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 22:40:42 +0200 Original-Received: from localhost ([::1]:54346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkZQn-0001Jd-Fn for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 16:40:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkZQ9-0000fe-5D for emacs-devel@gnu.org; Sun, 14 Jun 2020 16:40:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52606) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkZQ8-0000HX-7S; Sun, 14 Jun 2020 16:40:00 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:39727) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jkZQ7-0007sT-UA; Sun, 14 Jun 2020 16:40:00 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 8A66727C0054; Sun, 14 Jun 2020 16:39:59 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 14 Jun 2020 16:39:59 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiiedgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dtleeiffekueffudeufeefhfeitdejuedtueevgeffgfdtjeelkeehgeekteekveenucfk phepleefrddvfeeirddufeeirdefudenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgr lhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgse hfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from thinkpad-t440p (p5dec881f.dip0.t-ipconnect.de [93.236.136.31]) by mail.messagingengine.com (Postfix) with ESMTPA id C98793280065; Sun, 14 Jun 2020 16:39:57 -0400 (EDT) Mail-Followup-To: Dmitry Gutov , Stefan Monnier , emacs-devel@gnu.org In-Reply-To: (Dmitry Gutov's message of "Sun, 14 Jun 2020 22:41:17 +0300") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252249 Archived-At: Dmitry Gutov writes: > On 14.06.2020 19:30, Tassilo Horn wrote: >> +(defun vc-git-repository-url (file-or-dir) >> + (let ((default-directory (vc-git-root file-or-dir))) >> + (with-temp-buffer >> + (vc-git--call (current-buffer) "ls-remote" "--get-url") >> + (buffer-substring-no-properties (point-min) (1- (point-max)))))) > > Can it be used in vc-git-dir-extra-headers, to replace the logic that > calculates the value of 'remote'? Actually, "git ls-remote --get-url" doesn't work satisfactory which I noticed after committing above change on a new local branch. In that case, it returned "." so I've changed to this version (defun vc-git-repository-url (file-or-dir) (let ((default-directory (vc-git-root file-or-dir))) (with-temp-buffer (vc-git-command (current-buffer) 0 nil "remote" "get-url" "origin") (buffer-substring-no-properties (point-min) (1- (point-max)))))) where I explicitly name the remote "origin" (which, I know, doesn't need to exist but still works in 99% of all cases). Bye, Tassilo