Thread (19 messages) flat view 19 messages, 3 authors, 2026-08-14
COLD41d

Revision v3 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current

[PATCH v3 0/3] completion of 'git [-C <dir>] checkout'

From: Junio C Hamano <hidden>
Date: 2026-08-13 19:12:37

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-g9dcc51a0fd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help