From: Junio C Hamano Date: Wed, 05 Aug 2026 19:42:47 GMT Subject: [PATCH v3 0/3] completion of 'git [-C ] diff' Message-ID: <20260805194250.3316220-1-gitster@pobox.com> In-Reply-To: Here is another reroll. The primary motivation for this topic is that the command-line completion of 'git diff' does not handle paths (unlike 'git status' and 'git add') and instead relies on the default behavior of Bash command-line completion, which completes files in $PWD; this does not work at all with the '-C ' option. Previous iterations of the patch taught the completion script to offer tracked paths that match the prefix before to improve the situation. This time, we also complete untracked paths ourselves, so that even the following commands, which compare files like 'file[12]' that are not under the control of Git in a different directory, are completed: $ git -C not-a-git-dir diff fil $ git -C not-a-git-dir diff --no-index fil 1/3: completion: no-op refactoring of diff completion 2/3: completion: complete tracked paths for 'git diff' 3/3: completion: 'git diff' completes untracked paths as a last resort contrib/completion/git-completion.bash | 69 +++++++++++++++----------- t/t9902-completion.sh | 59 ++++++++++++++++++++++ 2 files changed, 100 insertions(+), 28 deletions(-)