From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: RFC: Automatic setup for bug-reference-mode Date: Thu, 18 Jun 2020 00:35:51 +0300 Organization: LINKOV.NET Message-ID: <87ftatcr48.fsf@mail.linkov.net> References: <87r1uihtsu.fsf@gnu.org> <87h7vd3cbs.fsf@gnu.org> <87tuzdsj8d.fsf@gnu.org> <87tuzd755z.fsf@gnu.org> <86o8pkabzh.fsf@stephe-leake.org> <87pna0mxxw.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="94754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 18 00:01:27 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 1jlg7a-000OWe-3w for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Jun 2020 00:01:26 +0200 Original-Received: from localhost ([::1]:54560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlg7Z-0008QB-0s for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jun 2020 18:01:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfkh-0000OB-TA for emacs-devel@gnu.org; Wed, 17 Jun 2020 17:37:47 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlfkf-0005zw-F2 for emacs-devel@gnu.org; Wed, 17 Jun 2020 17:37:47 -0400 X-Originating-IP: 91.129.108.6 Original-Received: from mail.gandi.net (m91-129-108-6.cust.tele2.ee [91.129.108.6]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2D1BF1BF203; Wed, 17 Jun 2020 21:37:40 +0000 (UTC) In-Reply-To: <87pna0mxxw.fsf@gnu.org> (Tassilo Horn's message of "Mon, 15 Jun 2020 12:21:31 +0200") Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/17 17:37:42 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:252287 Archived-At: >>> (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). >> >> I'm in the 1%; I have git repositories that don't have 'origin'; they >> have 'savannah'. I migrated from monotone, where the remotes have real >> names. >> >> So some method of overriding 'origin' would be appreciated. > > It already has on master, i.e., you can pass in an optional remote-name. Typing 'C-x v d' (vc-dir) on a repository without 'origin' raises the error "Failed (status 128): git --no-pager remote get-url ."