mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
Improved git-add completion
* lisp/pcmpl-git.el (pcomplete/git)): Complete untracked files. (Bug#75336) Copyright-paperwork-exempt: yes
This commit is contained in:
parent
ba5360f700
commit
2fd72a6ed3
1 changed files with 11 additions and 1 deletions
|
|
@ -82,8 +82,18 @@ Files listed by `git ls-files ARGS' satisfy the predicate."
|
||||||
(pcomplete-from-help `(,vc-git-program "help" ,subcmd)
|
(pcomplete-from-help `(,vc-git-program "help" ,subcmd)
|
||||||
:argument
|
:argument
|
||||||
"-+\\(?:\\[no-\\]\\)?[a-z-]+=?"))))
|
"-+\\(?:\\[no-\\]\\)?[a-z-]+=?"))))
|
||||||
|
;; Complete modified tracked files and untracked files and
|
||||||
|
;; ignored files if -f or --force is specified.
|
||||||
|
("add"
|
||||||
|
(pcomplete-here
|
||||||
|
(pcomplete-entries
|
||||||
|
nil
|
||||||
|
(let ((flags (list "-o" "-m")))
|
||||||
|
(unless (or (member "-f" pcomplete-args) (member "--force" pcomplete-args))
|
||||||
|
(push "--exclude-standard" flags))
|
||||||
|
(apply #'pcmpl-git--tracked-file-predicate flags)))))
|
||||||
;; Complete modified tracked files
|
;; Complete modified tracked files
|
||||||
((or "add" "commit" "restore")
|
((or "commit" "restore")
|
||||||
(pcomplete-here
|
(pcomplete-here
|
||||||
(pcomplete-entries
|
(pcomplete-entries
|
||||||
nil (pcmpl-git--tracked-file-predicate "-m"))))
|
nil (pcmpl-git--tracked-file-predicate "-m"))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue