From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#65315: 30.0.50; vc-dir fails with Git < 2.7.0 Date: Tue, 15 Aug 2023 11:52:35 -0700 Message-ID: <25819.51571.336510.375273@orion.rgrjr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="M9mW0FrQOG" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4449"; mail-complaints-to="usenet@ciao.gmane.io" To: 65315@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 15 20:53:30 2023 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 1qVzAX-0000sX-MR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Aug 2023 20:53:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVzAB-0001ym-TF; Tue, 15 Aug 2023 14:53:08 -0400 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 1qVzA7-0001yJ-Aq for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 14:53:03 -0400 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 1qVzA7-0003up-3Y for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 14:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVzA6-0000SD-Gf for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 14:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Aug 2023 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65315 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16921255741725 (code B ref -1); Tue, 15 Aug 2023 18:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Aug 2023 18:52:54 +0000 Original-Received: from localhost ([127.0.0.1]:36619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVz9x-0000Rl-V3 for submit@debbugs.gnu.org; Tue, 15 Aug 2023 14:52:54 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:48726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVz9s-0000RT-W7 for submit@debbugs.gnu.org; Tue, 15 Aug 2023 14:52:52 -0400 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 1qVz9n-0001vq-9Q for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 14:52:43 -0400 Original-Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVz9j-0003qG-WC for bug-gnu-emacs@gnu.org; Tue, 15 Aug 2023 14:52:43 -0400 Original-Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bc34b32785so35940505ad.3 for ; Tue, 15 Aug 2023 11:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rgrjr-com.20221208.gappssmtp.com; s=20221208; t=1692125558; x=1692730358; h=subject:to:date:message-id:content-transfer-encoding:mime-version :from:from:to:cc:subject:date:message-id:reply-to; bh=rYJAEeBzwTLqsgR6xrkn5oChIuQnYiEIBKZ/bZd1P4M=; b=VWFMeSXFmBwcT9qpPr2HeXYkPXsJ6tyH4JqDZXPy+Y0VjlwjhdGOGWLwCvVUUiGU4g WQ482fZPAxaDMHtForHvyfsjZ1e9fs2HPVBraTuVVRJIvdZicp9NR8ZLANbtLhfgKO3a wEUp2/V8y87XGI9NocJ9X1HOTHDdovogdXTzRH2KP9+GRROB1UPN6PxSsbE7EZnBsPLg JGKC53DKUorE69zjQYB04vNxDK4f2bh07LxlZ86pLfh2lodLttMdlll3k8hfv5eKGQ6r Lc1ZZrCDJ1ahfoKiayfYqFSKsBtPFio17IPN0UE6PuxNeSd7gejUn4S84QoWCMo4f26r tMqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692125558; x=1692730358; h=subject:to:date:message-id:content-transfer-encoding:mime-version :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rYJAEeBzwTLqsgR6xrkn5oChIuQnYiEIBKZ/bZd1P4M=; b=jEuVBKCodiuhBRYvlZYUal/F/OPwEIc3KlupxlbtqvqLZoKbbhQeOutqvM9aZGMSUe 68kcKmg0eoP4Vh/xTzome43gIbiBB1aEsvZjEViGX2XxYIquFqhgt3eCOxcueD1mo7kA JmOgG70+lTljKDxcxddrKFExTR7MISSjig7iV7wS+rDE2xR+0jTeDVSAdJziOHUX5dfW Hf9ZX3DKsE5aKorxdwjhiU7ZIYOslAmGVdVcK75XEave4KOSJdMoW6Wuyehk0I/iIwiw L8Xv/IaBhW+wWMIaNgefXrHUV+wJyw+JU+qIVDuiXOlVzJBAQsw2si9SLAfj6o49pDSZ LwJA== X-Gm-Message-State: AOJu0YzwWCdU3CKcwlhR0inKJZGyKzvjjCFr1pAQjTzeETqQNpLpUjma s2v+V6QOBqSoJyN7H7QY6BG2Gz85rR9J5CHRm8Q= X-Google-Smtp-Source: AGHT+IFb+qoAMA7S0grdHas/rhtncr3aRd73LN4gDHrVDK3hI/c1k8cEIkSiPbt3bXoNWQ90DlOfdQ== X-Received: by 2002:a17:902:e844:b0:1b6:4bbd:c3a7 with SMTP id t4-20020a170902e84400b001b64bbdc3a7mr13041394plg.66.1692125558081; Tue, 15 Aug 2023 11:52:38 -0700 (PDT) Original-Received: from orion.rgrjr.com ([2600:1700:7c2c:e000::22]) by smtp.gmail.com with ESMTPSA id y12-20020a170902b48c00b001bb892a7a67sm11388843plr.1.2023.08.15.11.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 11:52:37 -0700 (PDT) X-Mailer: VM 8.2.0b under 30.0.50 (x86_64-pc-linux-gnu) Received-SPF: none client-ip=2607:f8b0:4864:20::629; envelope-from=rogers@rgrjr.com; helo=mail-pl1-x629.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:267514 Archived-At: --M9mW0FrQOG Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit 1. On a system with a version of Git older than 2.7.0, navigate to a git-controlled directory and invoke "emacs -Q". 2. With this as the default directory, invoke vc-dir. This fails with the error "vc-do-command: Failed (status 129): git --no-pager remote get-url origin ." This is because the "get-url" subcommand of "git remote", used by vc-git-repository-url, was added in 2.7.0 [1]. The attached patch against master rev 1db7e8eba961e88181879213dd5374ad9e87ac76 uses "git config" in a way that works in both old and new systems (tested with git 2.1.2 and git 2.35.3). Of course, supporting 7+-year-old versions of git is probably not a high priority, so I won't be too disappointed if this fix is rejected. On the other hand, it's a small change, and having vc-dir fail on any system, especially when using Git, puts a big damper on being able to use Emacs to hack on things in older systems, so I think it's worth having. -- Bob Rogers http://www.rgrjr.com/ [1] https://github.com/git/git/blob/master/Documentation/RelNotes/2.7.0.txt, line 13. ------------------------------------------------------------------------ In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) of 2023-08-15 built on orion Repository revision: 1db7e8eba961e88181879213dd5374ad9e87ac76 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: openSUSE Leap 15.5 Configured using: 'configure --with-dbus=no --with-gsettings=no --with-gif=ifavailable --with-tiff=no --with-gnutls=yes --with-gconf=no' Configured features: ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix --M9mW0FrQOG Content-Type: text/x-patch; name="make-vc-git-repository-url-work-pre-2.7.0.patch" Content-Description: Content-Disposition: inline; filename="make-vc-git-repository-url-work-pre-2.7.0.patch" Content-Transfer-Encoding: 7bit diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index dfca944dc74..a7763360795 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1342,8 +1342,10 @@ vc-git-conflicted-files (defun vc-git-repository-url (file-or-dir &optional remote-name) (let ((default-directory (vc-git-root file-or-dir))) (with-temp-buffer - (vc-git-command (current-buffer) 0 nil "remote" "get-url" - (or remote-name "origin")) + ;; The "get-url" subcommand of "git remote" was new in git 2.7.0; + ;; "git config" also works in older versions. -- rgr, 15-Aug-23. + (let ((opt-name (concat "remote." (or remote-name "origin") ".url"))) + (vc-git-command (current-buffer) 0 (list "config" "--get" opt-name))) (buffer-substring-no-properties (point-min) (1- (point-max)))))) ;; Everywhere but here, follows vc-git-command, which uses vc-do-command --M9mW0FrQOG--