zsh-workers
 help / color / mirror / code / Atom feed
* git worktree add /foo <TAB>
@ 2017-08-09 19:31 Daniel Shahaf
  2017-08-14 11:57 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Shahaf @ 2017-08-09 19:31 UTC (permalink / raw)
  To: zsh-workers

The second argument to 'git worktree add' can be any committish.  That
committish becomes HEAD of the new worktree, and if it's a branch name,
then that branch becomes the current branch of the new worktree, else
the new worktree starts as a detached HEAD.

How should that be completed?

Currently it's completed as follows:

+++ b/Completion/Unix/Command/_git
@@ -2026,11 +2026,7 @@ _git-worktree() {
       curcontext=${curcontext%:*}-$line[1]:
       case $line[1] in
         (add)
 	  if (( $words[(I)--detach] )); then
 	    args=( ':commit:__git_commits' )
 	  else
 	    args=( ':branch:__git_branch_names' )
 	  fi

… and while simply using __git_commits unconditionally wouldn't be
wrong, I think this case might prefer a variant of __git_commits that
offers branch names in preference to the N other things __git_commits
offers.  Do we have such a helper?

(Or should I just add another tag-order style to my config...?)

I see __git_recent_branches but it's not precisely what I have in mind.

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-16  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 19:31 git worktree add /foo <TAB> Daniel Shahaf
2017-08-14 11:57 ` Oliver Kiddle
2017-08-16  4:26   ` Daniel Shahaf
2017-08-16  9:37     ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).