From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4593 invoked from network); 18 Aug 2008 01:47:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Aug 2008 01:47:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 21029 invoked from network); 18 Aug 2008 01:46:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Aug 2008 01:46:33 -0000 Received: (qmail 8844 invoked by alias); 18 Aug 2008 01:46:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25475 Received: (qmail 8823 invoked from network); 18 Aug 2008 01:46:21 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 Aug 2008 01:46:21 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 18D5A805A42F for ; Mon, 18 Aug 2008 03:46:15 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id 95A1010408A; Mon, 18 Aug 2008 01:46:13 +0000 (UTC) Date: Mon, 18 Aug 2008 01:46:13 +0000 From: Clint Adams To: zsh-workers Subject: Re: Fix a typo in _git. Message-ID: <20080818014613.GA30193@scru.org> Mail-Followup-To: zsh-workers References: <237967ef0808151656j7787f169g4b3456910e05bfc2@mail.gmail.com> <20080817171321.GA24334@scru.org> <237967ef0808171027t4773ff36nb1cfe08942b63a5f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <237967ef0808171027t4773ff36nb1cfe08942b63a5f@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8051/Sat Aug 16 05:44:59 2008 on bifrost X-Virus-Status: Clean On Sun, Aug 17, 2008 at 07:27:31PM +0200, Mikael Magnusson wrote: > git branch is a UI command, it's not guaranteed to always indicate the current > branch with a * for example. It also doesn't tell you if a branch is > in refs/heads > or refs/remotes. The completion doesn't differentiate between those yet, but > it definitely should, I don't think I'll be able to fix that though. > > As for _call_program, I don't really know what the purpose of that is. I don't > have a reason for not using it though. _call_program tag string ... This function provides a mechanism for the user to over‐ ride the use of an external command. It looks up the command style with the supplied tag. If the style is set, its value is used as the command to execute. The strings from the call to _call_program, or from the style if set, are concatenated with spaces between them and the resulting string is evaluated. The return sta‐ tus is the return status of the command called. > You have the same broken reply-to as the other guy, which means you > won't be in the to: field, and i have to remove myself manually each > time. > Either that, or gmail is doing something non-standard. You might mean Mail-Followup-To. This changes the _call_program tags since the outputs are incompatible; anyone with styles set for these will have them silently stop working. Index: Completion/Unix/Command/_git =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v retrieving revision 1.75 diff -u -r1.75 _git --- Completion/Unix/Command/_git 17 Aug 2008 14:05:59 -0000 1.75 +++ Completion/Unix/Command/_git 18 Aug 2008 01:44:40 -0000 @@ -2966,7 +2966,7 @@ local expl declare -a branch_names - branch_names=(${${(f)"$(_call_program heads git branch --no-color -a 2>/dev/null)"}#[* ] }) + branch_names=(${${(f)"$(_call_program headrefs git for-each-ref --format='%(refname)' refs/heads refs/remotes 2>/dev/null)"}#refs/(heads|remotes)/}) __git_command_successful || return _wanted heads expl branch-name compadd $* - $branch_names HEAD @@ -2977,7 +2977,7 @@ local expl declare -a tag_names - tag_names=(${${(f)"$(_call_program tags git tag -l 2>/dev/null)"}#[* ] }) + tag_names=(${${(f)"$(_call_program tagrefs git for-each-ref --format='%(refname)' refs/tags 2>/dev/null)"}#refs/tags/}) __git_command_successful || return _wanted tags expl tag-name compadd $* - $tag_names @@ -3030,7 +3030,7 @@ local expl declare -a branch_names - branch_names=(${${(f)"$(_call_program branch-names git branch --no-color 2>/dev/null)"}#[* ] }) + branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='%(refname)' refs/heads 2>/dev/null)"}#refs/heads/}) __git_command_successful || return _wanted branch-names expl branch-name compadd $* - $branch_names