Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] vcs_info - git branch with % in it's name
- X-seq: zsh-workers 42187
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] vcs_info - git branch with % in it's name
- Date: Sat, 30 Dec 2017 08:56:06 +0000
- Cc: Doron Behar <doron.behar@xxxxxxxxx>
- 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 ==
- In-reply-to: <20171225201728.6e2iwqm5loqbbjsr@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20171225093306.6druy3zqyjx2rcyr@NUC.localdomain> <20171225201728.6e2iwqm5loqbbjsr@tarpaulin.shahaf.local2>
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]} \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author