Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
vcs_info: quoting (backticks) in git_patches_applied
- X-seq: zsh-workers 33386
- From: Daniel Hahler <dhahler@xxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: vcs_info: quoting (backticks) in git_patches_applied
- Date: Wed, 08 Oct 2014 17:25:53 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=vRHYeQIOfUkP0K5CDOhTa/j5eKFMyEYWmhcrR/Jb8G8=; b=Bf6+sjll7uap1jdhe2ilY1ouastjIA+7Q6ayIQwrfYmKT6i6z4gMww4Y5tPf4AJcnP QwlKnByfmaePuc1abq1a6vDSQrqTvZm60TK/MbxmSfjjwsX5VF1MDVYc2ca9gZ4DyZ4V tEdAmKEI2lpbQNQLjXT+DLZxgOb5weRTRwfU2zZKbpbWtwv1OyErQ/uQc6YiWRlHFEUS np7u2MyTAyAFX34YlL866CIVRbglHzdhfJS+HQMSxcFBHFlooTt46eI8kJ+EIwpsi4N0 jTGu1OIccE2wUnnm8AV9/qCGzMd+Tx/CuYllq5bQHIKIIml1zIBaY3TM8wjSw2CRSEPZ FHsg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I've noticed that there is a problem when using `%m` in vcs_info,
where the default `get-applied-string` hook returns something with
backticks in it:
> 6410ed117e51a4288d06132d18e2ffdf33f51313 Add snippets `'`, `"` and `doc`
While the backticks can be replaced in the prompt itself, it might be
better to quote it in `VCS_INFO_git_handle_patches`:
diff --git i/Functions/VCS_Info/Backends/VCS_INFO_get_data_git w/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index ee50be6..371e935 100644
--- i/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ w/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -121,7 +121,7 @@ VCS_INFO_git_handle_patches () {
if VCS_INFO_hook 'gen-applied-string' "${git_patches_applied[@]}"; then
if (( ${#git_patches_applied} )); then
- git_applied_s=${git_patches_applied[1]}
+ git_applied_s=${(qqq)git_patches_applied[1]}
else
git_applied_s=""
fi
There is probably a better place to apply the quoting, e.g. when reading
the patches from the file, or a more central place in vcs_info, because
this is likely to affect other backends, too.
Regards,
Daniel.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author