Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vcs_info: quoting (backticks) in git_patches_applied

Hello Daniel,

Daniel Hahler wrote:
> I've noticed that there is a problem when using `%m` in vcs_info,
> where the default `get-applied-string` hook returns something with

I'm a bit confused. There is no default gen-applied-string hook.

> backticks in it:
>> 6410ed117e51a4288d06132d18e2ffdf33f51313 Add snippets `'`, `"` and `doc`

And there is no such commit in zsh's git repository.

> While the backticks can be replaced in the prompt itself, it might be
> better to quote it in `VCS_INFO_git_handle_patches`:
>     -            git_applied_s=${git_patches_applied[1]}
>     +            git_applied_s=${(qqq)git_patches_applied[1]}
> 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.

I don't think we should post-process these values. The hooks should
return properly quoted data (I suppose your problem is that your hook
does returns a - maybe even single - backtick and you use the
prompt_subst option which would cause problems) as the rest of the
configuration requires.

Correct me if I'm missing something.

Regards, Frank

Messages sorted by: Reverse Date, Date, Thread, Author