Subject: bug#76356: closed (Re: bug#76356: [PATCH] Add file completion for git apply, am to pcomplete)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 17 Feb 2025 23:04:02 +0000

Your bug report

#76356: [PATCH] Add file completion for git apply, am to pcomplete

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76356: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76356
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#76356: [PATCH] Add file completion for git apply, am to pcomplete
From: Stefan Kangas <[email-masked]>
To: Antero Mejr <[email-masked]>, [email-masked]
Date: Mon, 17 Feb 2025 23:03:44 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 31.1

Antero Mejr <[email-masked]> writes:

> This patch lets pcomplete recognize the "git apply" and "git am"
> subcommands and complete filenames for patch files. This is helpful for
> eshell.

Thanks for the patch.  Installed and closing.

Subject: [PATCH] Add file completion for git apply, am to pcomplete
From: Antero Mejr <[email-masked]>
To: [email-masked]
Date: Sun, 16 Feb 2025 23:33:32 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

This patch lets pcomplete recognize the "git apply" and "git am"
subcommands and complete filenames for patch files. This is helpful for
eshell.

>From 2c620140d45e4bcb3ea5d52470b6d6d783f1dcc4 Mon Sep 17 00:00:00 2001
From: Antero Mejr <[email-masked]>
Date: Tue, 28 Jan 2025 13:39:10 -0500
Subject: [PATCH] Add file completion for git apply, am to pcomplete

* lisp/pcmpl-git.el (pcomplete/git): Add an "apply" and "am" clause to
complete all files.
---
 lisp/pcmpl-git.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/pcmpl-git.el b/lisp/pcmpl-git.el
index f23002df28b..02af87f839d 100644
--- a/lisp/pcmpl-git.el
+++ b/lisp/pcmpl-git.el
@@ -114,7 +114,10 @@ Files listed by `git ls-files ARGS' satisfy the predicate."
                ;; Complete remotes and their revisions
                ((or "fetch" "pull" "push")
                 (pcomplete-here (process-lines vc-git-program "remote"))
-                (pcomplete-here (pcmpl-git--remote-refs (pcomplete-arg 1)))))))))
+                (pcomplete-here (pcmpl-git--remote-refs (pcomplete-arg 1))))
+               ;; Complete all files
+               ((or "apply" "am")
+                (pcomplete-here (pcomplete-entries))))))))
 
 (provide 'pcmpl-git)
 ;;; pcmpl-git.el ends here
-- 
2.43.0