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)
|
||||
:argument
|
||||
"-+\\(?:\\[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
|
||||
((or "add" "commit" "restore")
|
||||
((or "commit" "restore")
|
||||
(pcomplete-here
|
||||
(pcomplete-entries
|
||||
nil (pcmpl-git--tracked-file-predicate "-m"))))
|
||||
|
|
Loading…
Add table
Reference in a new issue