From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#68183: 28.3; vc-dir fails when I have a certain branch checked out Date: Wed, 03 Jan 2024 10:46:39 +0100 Message-ID: <87h6jun400.fsf@gmail.com> References: <8734vici68.fsf@tromey.com> <83y1da17zw.fsf@gnu.org> <87y1dab03x.fsf@tromey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25075"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 68183@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 03 10:47:17 2024 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 1rKxqG-0006Hk-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jan 2024 10:47:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKxq1-0006ZP-Ic; Wed, 03 Jan 2024 04:47:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKxpz-0006ZC-UO for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 04:46:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKxpz-0004Ju-MQ for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 04:46:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKxq2-0003sE-8P for bug-gnu-emacs@gnu.org; Wed, 03 Jan 2024 04:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jan 2024 09:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68183 X-GNU-PR-Package: emacs Original-Received: via spool by 68183-submit@debbugs.gnu.org id=B68183.170427521314875 (code B ref 68183); Wed, 03 Jan 2024 09:47:02 +0000 Original-Received: (at 68183) by debbugs.gnu.org; 3 Jan 2024 09:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:51887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKxpt-0003rr-1X for submit@debbugs.gnu.org; Wed, 03 Jan 2024 04:46:53 -0500 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:61518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKxpq-0003rb-PG for 68183@debbugs.gnu.org; Wed, 03 Jan 2024 04:46:51 -0500 Original-Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40d8902da73so17291435e9.2 for <68183@debbugs.gnu.org>; Wed, 03 Jan 2024 01:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704275201; x=1704880001; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DdA7eC7P5dXfAFjxqDT36UTWemLzMtujT5LkY7PdCbM=; b=BfphXhqvrye19Xo75Q6gw/6x6GbI9peq4Ry2t8xIypO2qI3Db/V3o/vUvrwbjwo1uX 56mfWyWz/oXWoQHLlHUB1fF2Sbw4U6HqW/6xfJsgj2C7HwsEfkcZQS+rdh/hYBPex6Kf dCOvPQZZrGuIx6cmXhybV+sLQZ4pTN5CbgB4b2KE7sEPz2QW68G/ya3zQDGA8moVGb0E ok8NYFwpkTo277yVPL1niLYIUYyGVH8Qu7erFoCzg4MBrrW4WQHztIvYorzVC3e+REdM 7sODu9nGDac2mcWbJcqFDpkQkjGM9qK71f6nHnN7oL5e5RHxN3ntsc3mKUvcm18cYcPT by0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704275201; x=1704880001; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DdA7eC7P5dXfAFjxqDT36UTWemLzMtujT5LkY7PdCbM=; b=h6QSYhhIDkz6THWjHalms/C0BlIkqslBPaKbWD+m1nrGxmnYKw+hE9qd/cybHlGloS leFBDo4vyOmxkHrq2YXsd0xuamvTK0CAAGPqafQJ4kKc20RpjePOIoKr0c2WMBrTShXq DUq0eo6TmcOJQTlHQcm4Bd2ofmCIMhYs2TCC6pIWEZzBLPdMvjw1+HFdxePeQVBTzdqC mJNDOCj5wH5eXUCHlprQ2j3SmThIT+5e/Ecet3NqkeA42KTAW/ijvTQP5fEfAu6edfIt IZFS/QTXUjM4KwYkpo+KO/+USbglCRECjQY0EK/uNV/RbX+SAbsawkfxcu1j/jPSE6sJ wk7A== X-Gm-Message-State: AOJu0YzoptUio5Q9MNjdPZBu+qQW93jeEYKtcemHsE4L6kd0XlcK74gG xm9nvsiJ0arVj/JB60HtzIjgdfQW9aA= X-Google-Smtp-Source: AGHT+IFxWB71d/iUvMDUtDT+5QqbVEPLhYotivX3IIBlGtfxWnh+9EwlSvPTzUgNQFbZekzIGjQMMg== X-Received: by 2002:a05:600c:2313:b0:40d:81c3:2e2b with SMTP id 19-20020a05600c231300b0040d81c32e2bmr3862230wmo.60.1704275201206; Wed, 03 Jan 2024 01:46:41 -0800 (PST) Original-Received: from hirondell ([2001:861:38ca:5f70:7347:9ec1:df7c:18ef]) by smtp.gmail.com with ESMTPSA id g15-20020a5d488f000000b00336e43e8e57sm18986333wrq.58.2024.01.03.01.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 01:46:40 -0800 (PST) In-Reply-To: <87y1dab03x.fsf@tromey.com> (Tom Tromey's message of "Sun, 31 Dec 2023 13:14:42 -0700") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277269 Archived-At: Tom Tromey writes: > Eli> Thanks, but I think we'd appreciate a reproducible recipe for this: > Eli> how can one create a Git repository which can be used to reproduce > Eli> this issue? > > This worked for me: > > $ cd ~/Emacs/trunk > # This is my Emacs git repository > $ git checkout --track -b vc-dir-bug master > branch 'vc-dir-bug' set up to track 'master'. > Switched to a new branch 'vc-dir-bug' > > > Now invoke vc-dir on that directory. I can reproduce; IIUC the salient point is setting start-point to a local revision when calling git checkout, by opposition to e.g. origin/master. Continuing off of your recipe: $ git branch --set-upstream-to origin/master Then M-x vc-dir works again. IIUC, to display Remote : https://git.savannah.gnu.org/git/emacs.git vc-git-dir-extra-headers runs 1. git config branch.vc-dir-bug.remote =E2=87=92 "." 2. (vc-git-repository-url "[=E2=80=A6 EMACS DIR =E2=80=A6]" ".") 1. git config remote...url =E2=87=92 error git-config(1) says that branch..remote is "." when is tracking a local branch, whereas branch..merge points to the local branch 'git pull' will resync with. Wonder what TRT would be for the purposes of vc-dir? (1) Drop the "Remote" header: the current branch is not sync'd with a remote branch, after all. (2) Print "Remote: https://git.savannah.gnu.org/git/emacs.git" by making vc-git-repository-url fall back to remote.origin.url when remote-name is ".". (3) Print "Remote: master" by making vc-git-dir-extra-headers fall back to branch..merge when .remote is ".". (4) Make vc-git-dir-extra-headers fall back to branch..merge>.remote. In our example, that would yield "Remote: https://git.savannah.gnu.org/git/emacs.git", but in general that seems unreliable, since that remote could be "." as well, and nothing prevents cycles AFAIU. IMO (3) would be the most robust, though maybe confusing (calling a local branch "remote"); (2) makes sense as well since vc-git-repository-url already falls back to remote.origin.url when remote-name is nil. (1) sounds trivially "robust" and "not too incorrect", but maybe not the most helpful. (4) is under-specified and I'm not convinced it is possible to make it generally useful. Hope I've not mis-diagnosed the problem; apologies for the noise if so.