git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Elijah Newren <newren@gmail.com>
Date
Aug 14, 2026, 01:53 UTC
Message-ID
<CABPp-BFeLStBR3OeTCJoBmC7cn_VXrn4RcvBg-WWGyz4LpJxsg@mail.gmail.com>
In-Reply-To
<20260813191234.1066662-1-gitster@pobox.com>
On Thu, Aug 13, 2026 at 12:12 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
>
> 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
This version looks good to me; thanks!
Previous: Junio C Hamano
Message 19 of 19 in “completion of 'git [-C <dir>] checkout'”
  1. 0/2 completion of 'git [-C <dir>] checkout'Junio C Hamano, Aug 11, 2026
  2. 1/2 completion: no-op refactoring of checkout completionJunio C Hamano, Aug 11, 2026
  3. 2/2 completion: complete tracked paths for "git checkout"Junio C Hamano, Aug 11, 2026
  4. Ben KnobleAug 11, 2026
  5. Junio C HamanoAug 11, 2026
  6. Junio C HamanoAug 11, 2026
  7. Ben KnobleAug 11, 2026
  8. Junio C HamanoAug 12, 2026
  9. 0/3 completion of 'git [-C <dir>] checkout'Junio C Hamano, Aug 12, 2026
  10. 1/3 completion: no-op refactoring of checkout completionJunio C Hamano, Aug 12, 2026
  11. 2/3 completion: complete tracked paths for "git checkout"Junio C Hamano, Aug 12, 2026
  12. 3/3 completion: 'git checkout' completes untracked paths as a last resortJunio C Hamano, Aug 12, 2026
  13. Elijah NewrenAug 12, 2026
  14. Junio C HamanoAug 12, 2026
  15. 0/3 completion of 'git [-C <dir>] checkout'Junio C Hamano, Aug 13, 2026
  16. 1/3 completion: no-op refactoring of checkout completionJunio C Hamano, Aug 13, 2026
  17. 2/3 completion: complete tracked paths for "git checkout"Junio C Hamano, Aug 13, 2026
  18. 3/3 completion: 'git checkout' completes untracked paths as a last resortJunio C Hamano, Aug 13, 2026
  19. Elijah NewrenAug 14, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.