zsh-workers
 help / color / mirror / code / Atom feed
* vcs_info: quoting (backticks) in git_patches_applied
@ 2014-10-08 15:25 Daniel Hahler
  2014-10-08 21:09 ` Frank Terbeck
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Hahler @ 2014-10-08 15:25 UTC (permalink / raw)
  To: Zsh Hackers' List

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-09 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-08 15:25 vcs_info: quoting (backticks) in git_patches_applied Daniel Hahler
2014-10-08 21:09 ` Frank Terbeck
2014-10-08 22:05   ` Daniel Hahler
2014-10-09 15:04     ` Frank Terbeck
2014-10-08 22:28   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).