From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5931 invoked by alias); 30 Dec 2017 08:56:13 -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: List-Unsubscribe: X-Seq: 42187 Received: (qmail 10550 invoked by uid 1010); 30 Dec 2017 08:56:13 -0000 X-Qmail-Scanner-Diagnostics: from out2-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.26):SA:0(-2.6/5.0):. Processed in 1.605159 secs); 30 Dec 2017 08:56:13 -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=-2.6 required=5.0 tests=BAYES_00,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=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=TuHLiB dovdo47xB0eQmUXmDPGF+DT9A5Q72/BKhBIOI=; b=TJSC47ON2XPZWgu6zeIWEA Cucyaw6PSneozvFRxWuRvZ1SALVUOgnLlaRB8TjvAR5/hseNlXumP9+E6Z2ndOjB rN3Tk6cLqwh6IwUgO4gGZhhYVoPseR9+RI59nP6BEuMM71Usb/n+B5KkCDb74D7J py9k1DvnnwoHa4kDlK/639zzHynzMMmsDXIDxujOwZclUs3BX3Bip9KE5PWd6uCp P0OsbuF3tjO6/ItbvY6AATq/SN5blj3NfP57DFE9WreIJhA0sSThuIuFsANEEi2i XJjimR8rm5Z0SxULoEU9Q/kbsSvR+e1q4OQGPR2cAYjaePzQPgjWAd5Z9NCtCGPA == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=TuHLiB dovdo47xB0eQmUXmDPGF+DT9A5Q72/BKhBIOI=; b=GVvxX1f/hnLBROdQDtc6ai GSpVfIsC0oGH67INloVUuCPmnx35jOr5tuDmw4+jTJFfVsFGJrZ7q6W9P8mCX9g8 T1oVj+Iglg0vZdz8U47gnCIqNbz6LdXSgE6W0a2rgWW8wd+1xPK+W1pa4wHP7nA4 b9uWHbQv4nwigKhHL8pSDF6Iou8sSv8XdSnElVV40oaizYfeGkPPjn6afE9GFrKr un/0eCDhvu0ZxquU9W28k9Hq9ZrAvxtDAC6vplJMbX1leAtYkO4srLCBSBTmZIBG vurUPUH1kn9ePCF7KMKmYA3XsEN5mtkXTcUK4bfRNElbZIWnBSnpEmJXq2Vsx50A == X-ME-Sender: Date: Sat, 30 Dec 2017 08:56:06 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Doron Behar Subject: Re: [BUG] vcs_info - git branch with % in it's name Message-ID: <20171230085606.oxjfq37p3hwv37ug@tarpaulin.shahaf.local2> References: <20171225093306.6druy3zqyjx2rcyr@NUC.localdomain> <20171225201728.6e2iwqm5loqbbjsr@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171225201728.6e2iwqm5loqbbjsr@tarpaulin.shahaf.local2> User-Agent: NeoMutt/20170113 (1.7.2) Daniel Shahaf wrote on Mon, Dec 25, 2017 at 20:17:28 +0000: > How about the following? If that is the right fix then the adjacent lines will > need similar tweaking. That's not so straightforward. Escaping the 'branch' value broke my post-backend hook, which was doing the equivalent of «hook_com[branch]+="%f↑"». That's fine; I wasn't expecting that hack to work forever, and I can just change it to «…+=$(print -rP "%f↑")». It might warrant a NEWS/README entry, but otherwise, no sweat. Next, if hook_com[staged] were escaped then settings such as «zstyle '*' stagedstr '%Bthis is bold%b'» would stop working. So, which hook_com keys should be escaped and which shouldn't? I don't see an easy way to tell. > diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats > index 4d0dd75c2..a46a10286 100644 > --- a/Functions/VCS_Info/VCS_INFO_formats > +++ b/Functions/VCS_Info/VCS_INFO_formats > @@ -81,7 +81,7 @@ for i in {1..${#msgs}} ; do > if VCS_INFO_hook "set-message" $(( $i - 1 )) "${msgs[$i]}"; then > zformat -f msg ${msgs[$i]} \ > a:${hook_com[action]} \ > - b:${hook_com[branch]} \ > + b:${hook_com[branch]//'%'/%%} \ > c:${hook_com[staged]} \ > i:${hook_com[revision]} \ > m:${hook_com[misc]} \