zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: git worktree add /foo <TAB>
Date: Wed, 9 Aug 2017 19:31:13 +0000	[thread overview]
Message-ID: <20170809193113.3gjq3ezigb6yvdu4@tarpaulin.shahaf.local2> (raw)

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


             reply	other threads:[~2017-08-09 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 19:31 Daniel Shahaf [this message]
2017-08-14 11:57 ` Oliver Kiddle
2017-08-16  4:26   ` Daniel Shahaf
2017-08-16  9:37     ` Oliver Kiddle

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809193113.3gjq3ezigb6yvdu4@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).