From: Jeff King <firstname.lastname@example.org> To: email@example.com Cc: Git <firstname.lastname@example.org> Subject: Re: Shell completion for branch names Date: Wed, 7 Apr 2021 16:00:49 -0400 [thread overview] Message-ID: <YG4PccicS0eH9gKG@coredump.intra.peff.net> (raw) In-Reply-To: <MXghkzCemail@example.com> On Wed, Apr 07, 2021 at 04:23:16PM +0200, firstname.lastname@example.org wrote: > I have a question regarding git-completion. I'm using zsh and have > added the function .git-completion.bash. That gives me some > auto-completion for branch names. > > What I'm looking for: I have a branch named > "feature/issue-123-add-feature" for example. I'd like to type "git > switch 123[tab]". Is there some function out there that provides this? Generally completion is done left-to-right for a partial string. The thing you are asking about is usually called "fuzzy" completion. You can use that term to find some discussion and tools that may help (e.g., ). I don't use any myself, so I can't comment on the quality. I'm also not sure if they can be used with custom completions like the one Git provides. One of the things Git's completion code does is turning those partial strings into a full set of options. In theory a fuzzy completion system could just feed Git's completion code an empty string to get all possibilities, and then do its own fuzzy match against it. But again, I don't know if anybody has written the glue code to do that kind of thing. -Peff  https://github.com/junegunn/fzf#fuzzy-completion-for-bash-and-zsh
next prev parent reply other threads:[~2021-04-07 20:00 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-07 14:23 jost.schulte 2021-04-07 19:52 ` Junio C Hamano 2021-04-07 20:00 ` Jeff King [this message] -- strict thread matches above, loose matches on Subject: below -- 2021-04-07 14:23 jost.schulte
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: http://vger.kernel.org/majordomo-info.html * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YG4PccicS0eH9gKG@coredump.intra.peff.net \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: Shell completion for branch names' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Code repositories for project(s) associated with this inbox: https://80x24.org/mirrors/git.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).