Re: [PATCH v3 0/3] completion of 'git [-C <dir>] checkout'
From: Elijah Newren <hidden>
Date: 2026-08-14 01:53:40
On Thu, Aug 13, 2026 at 12:12 PM Junio C Hamano [off-list ref] wrote:
Continuing from the previous 'git [-C <dir>] diff' series, these
patches correct completion for 'git checkout [-C <dir>] path<TAB>',
with a fallback to complete untracked paths of somewhat dubious
value, primarily as a reminder for future work.
Hopefully this will be the small and final update to the series.
1/3: completion: no-op refactoring of checkout completion
2/3: completion: complete tracked paths for "git checkout"
3/3: completion: 'git checkout' completes untracked paths as a last
resort
contrib/completion/git-completion.bash | 88 ++++++++++++++------------
t/t9902-completion.sh | 56 ++++++++++++++++
2 files changed, 105 insertions(+), 39 deletions(-)
Range-diff against v2:
1: 33d136ffde = 1: 33d136ffde completion: no-op refactoring of checkout completion
2: a28754cfd9 = 2: a28754cfd9 completion: complete tracked paths for "git checkout"
3: 90aec6539c ! 3: 17880068c0 completion: 'git checkout' completes untracked paths as a last resort
@@ contrib/completion/git-completion.bash: _git_checkout ()
fi
+
+ if [ ${#COMPREPLY[@]} -eq 0 ]; then
-+ __git_complete_index_file "--others"
++ __git_complete_index_file "--others --directory"
+ fi
}
--
2.55.0-759-g9dcc51a0fdThis version looks good to me; thanks!