From 62f1ed0b5ee6635a00b23ba86052974213bc5778 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 15 May 2020 20:15:19 +0200 Subject: [PATCH] completions/git: More files for `git commit` Fixes #7009. --- share/completions/git.fish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index a5167402f..b6ae82c1d 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -136,6 +136,8 @@ function __fish_git_files and set -l untracked_desc "Untracked file" contains -- modified-staged $argv; or set -ql all_staged; and set -l modified_staged and set -l staged_modified_desc "Staged modified file" + contains -- modified-staged-deleted $argv; or set -ql modified_staged; and set -l modified_staged_deleted + and set -l modified_staged_deleted_desc "Staged modified and deleted file" contains -- deleted $argv; and set -l deleted and set -l deleted_desc "Deleted file" contains -- deleted-staged $argv; or set -ql all_staged; and set -l deleted_staged @@ -260,6 +262,10 @@ function __fish_git_files set -ql modified and set file "$line[9..-1]" and set desc $modified_desc + case '1 MD*' + set -ql modified_staged_deleted + and set file "$line[9..-1]" + and set desc $modified_staged_deleted_desc case '1 M.*' # If the character is first ("M."), then that means it's "our" change, # which means it is staged. @@ -1011,7 +1017,7 @@ complete -f -c git -n '__fish_git_using_command clone' -l recursive -d 'Initiali ### commit complete -c git -n __fish_git_needs_command -a commit -d 'Record changes to the repository' complete -c git -n '__fish_git_using_command commit' -l amend -d 'Amend the log message of the last commit' -complete -f -c git -n '__fish_git_using_command commit' -a '(__fish_git_files modified)' +complete -f -c git -n '__fish_git_using_command commit' -a '(__fish_git_files modified deleted modified-staged-deleted untracked)' complete -c git -n '__fish_git_using_command commit' -s a -l all -d 'Automatically stage modified and deleted files' complete -c git -n '__fish_git_using_command commit' -s p -l patch -d 'Use interactive patch selection interface' complete -f -c git -n '__fish_git_using_command commit' -l fixup -d 'Fixup commit to be used with rebase --autosquash'