From de5b8c70fbc2c33a1ea980ae5ab2bdbacd480671 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 19 Dec 2025 02:26:59 +0200 Subject: [PATCH] Revert "vc-git-project-list-files: Restore support for Git < 2.13" This reverts commit 821c0d36dfa2f2cddb9d05a024a8248f2390f478. Despite re-enacting what the modern Git versions seem to do under the covers, the effect is not the same: filtering works differently. --- lisp/progmodes/project.el | 49 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 03d74a353e2..50287035833 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -723,31 +723,30 @@ See `project-vc-extra-root-markers' for the marker value format.") (and include-untracked '("-o")))) (when extra-ignores (setq args (append args - ;; Git <2.13 needs a positive pathspec first. - '("--" ".") - (mapcar - (lambda (i) - (format - ":(exclude,glob,top)%s" - (if (string-match "\\*\\*" i) - ;; Looks like pathspec glob - ;; format already. - i - (if (string-match "\\./" i) - ;; ./abc -> abc - (setq i (substring i 2)) - ;; abc -> **/abc - (setq i (concat "**/" i)) - ;; FIXME: '**/abc' should also - ;; match a directory with that - ;; name, but doesn't (git 2.25.1). - ;; Maybe we should replace - ;; such entries with two. - (if (string-match "/\\'" i) - ;; abc/ -> abc/** - (setq i (concat i "**")))) - i))) - extra-ignores)))) + (cons "--" + (mapcar + (lambda (i) + (format + ":(exclude,glob,top)%s" + (if (string-match "\\*\\*" i) + ;; Looks like pathspec glob + ;; format already. + i + (if (string-match "\\./" i) + ;; ./abc -> abc + (setq i (substring i 2)) + ;; abc -> **/abc + (setq i (concat "**/" i)) + ;; FIXME: '**/abc' should also + ;; match a directory with that + ;; name, but doesn't (git 2.25.1). + ;; Maybe we should replace + ;; such entries with two. + (if (string-match "/\\'" i) + ;; abc/ -> abc/** + (setq i (concat i "**")))) + i))) + extra-ignores))))) (setq files (delq nil (mapcar