From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5345 invoked by alias); 8 Oct 2014 15:26:02 -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: 33386 Received: (qmail 4146 invoked from network); 8 Oct 2014 15:26:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== X-Received: by 10.112.209.2 with SMTP id mi2mr11471005lbc.51.1412781955716; Wed, 08 Oct 2014 08:25:55 -0700 (PDT) From: Daniel Hahler X-Google-Original-From: Daniel Hahler Message-ID: <54355781.7080004@thequod.de> Date: Wed, 08 Oct 2014 17:25:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Zsh Hackers' List Subject: vcs_info: quoting (backticks) in git_patches_applied Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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.