From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50340: Fix remote-location in vc-git-log-incoming Date: Sun, 05 Sep 2021 19:36:54 +0300 Organization: LINKOV.NET Message-ID: <875yvfurkp.fsf@mail.linkov.net> References: <87k0jz9clq.fsf@mail.linkov.net> <87o89aaxhj.fsf@mail.linkov.net> <63fb440c-a393-541d-2f92-fe28130c899e@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3597"; 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: 50340@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 05 18:42:33 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 1mMvE0-0000qY-Uq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 18:42:32 +0200 Original-Received: from localhost ([::1]:43904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMvDz-0000tj-Vo for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 12:42:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMvDY-0008Uk-OV for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2021 12:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMvDY-00073q-H5 for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2021 12:42:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMvDY-0008F5-FS for bug-gnu-emacs@gnu.org; Sun, 05 Sep 2021 12:42:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Sep 2021 16:42:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50340-submit@debbugs.gnu.org id=B50340.163086012231650 (code B ref 50340); Sun, 05 Sep 2021 16:42:04 +0000 Original-Received: (at 50340) by debbugs.gnu.org; 5 Sep 2021 16:42:02 +0000 Original-Received: from localhost ([127.0.0.1]:50883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvDW-0008EL-6D for submit@debbugs.gnu.org; Sun, 05 Sep 2021 12:42:02 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:6293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvDU-0008Dp-FL for 50340@debbugs.gnu.org; Sun, 05 Sep 2021 12:42:00 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 05661240002; Sun, 5 Sep 2021 16:41:52 +0000 (UTC) In-Reply-To: <63fb440c-a393-541d-2f92-fe28130c899e@yandex.ru> (Dmitry Gutov's message of "Sat, 4 Sep 2021 04:50:35 +0300") 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:213514 Archived-At: >>>> - (vc-git-command nil 0 nil "fetch") >>>> + (vc-git-command nil 0 nil "fetch" (unless (string= remote-location "") >>>> + remote-location)) >>> >>> I'm not sure which scenario this fixes (pressing RET after 'C-u C-x v I' >>> works fine here), but it shouldn't hurt either. >> It fixes the scenario with a non-default remote. Could you try 'C-u C-x v I' >> and typing the name of a non-default remote in a repo with two remotes? >> I wonder if it already worked, and maybe I have some misconfiguration. > > Ah, I see what you are referring to. > > But does the feature work then? > > With your patch, I can pass some alternative upstream to the command, and > it fails at the end with something like: > > fatal: ambiguous argument 'HEAD..upstream': unknown revision or path not in > the working tree. > Use '--' to separate paths from revisions, like this: > 'git [...] -- [...]' But this means that my fix worked, because in vc-git-log-incoming I fixed the first command `git fetch`, but it fails in your case in the second command `git log HEAD..upstream`. >>> So if you have a stable repro (some alternative completing-read-function?), >>> you can go ahead and install. >> Regarding the default completing-read-function, the prompt of 'C-u C-x v I' >> doesn't provide completion on remote names. Maybe this should be improved >> as well. > > I guess some new backend action ('remote-locations'?) could help with that. Would be nice. Maybe just 'vc-read-revision' can be used, but by removing branch names after the slash in "upstream/branch", then uniquify remaining upstream names.