From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26615 invoked by alias); 9 Aug 2017 19:31:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41517 Received: (qmail 26660 invoked by uid 1010); 9 Aug 2017 19:31:24 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 2.985722 secs); 09 Aug 2017 19:31:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=aZfvC5QwKvicX1Xk0U 2K2fhr7dGYaM3QUReH8CBi1Dg=; b=UedNbnJ3bl7bqmiLiFGJg/zh8CQ8YSC3Oz YfAqfl/TbGvCP6i+T56hOJX46lmI7TNHcEydXpYPkKvgkxBM1yiHx9rYt1SUbBqr xH2iw+q5sscZYVE5hCm7yYj8bCaEcPunizR5+fkyovM2WQ/7yx6dZV42LC4WZcyh q+L8fCtu+wVsQ9EAbq5v4fYXWP8oq3+v/qZS2OE2h2Cc2T9QVHliFthdafVX4EDP Mo0dKrxfgWpzCvQ0/y5cSvcBtjRyJtN853m6lbzgdvPdTIpNWEKYCVemNlSI76Se bKD6wPma36OBW1aFm92s/10sF8SxTYvxnfqnt9tBdRYly8NZvvEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=aZfvC5QwKvicX1Xk0U 2K2fhr7dGYaM3QUReH8CBi1Dg=; b=qH9oGgz4aPzlxGOYsqkK97Jjxd06NF5hHA 4ySehSGLyIpHLsl14FdTHYtYO8WrJyBAn0Hf3wfL2N9dJazbGS3rSskR7LMFkmXQ r4gvOKdeZE0tNEHsiOoh4XcIEXI0SuTskWt8MS6khflv3VHM3Zbp7s321yWYJ4WN nTe2XeikmfuIQOZTVCFvXF6SQY9id1hGF6QP0u3oW/rKBdNm76qiAYtmKrHF+Llf /XUD0EEKWtz1IIaYvDARGiRNlzWXs8zxWc5UX3JCBvm3IdmR6NfFG81nnrmGf8EH ShdMrTtuyyvxe/QGqUC/vN+5sak9Dkc8N49tUuLiZU5Uqqy2A0wg== X-ME-Sender: X-Sasl-enc: YOqrvbUQndenKYVDMxVo6XdT8iD392yx654Z0yh9x1Ty 1502307074 Date: Wed, 9 Aug 2017 19:31:13 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: git worktree add /foo Message-ID: <20170809193113.3gjq3ezigb6yvdu4@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170113 (1.7.2) 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