From b110d6d5afe2c8529799b4ebd433399f080bcdf0 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 7 Apr 2021 20:22:58 +0000 Subject: 48435 (tweaked): vcs_info docs: applied-string/unapplied-string: Correct an omission in the documentation and add an example. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The example code is a reduced version of my function from workers/47519, with one bug fixed. (In workers/47519, if $1 doesn't contain spacesĀ - which is the case under hg mq - then $H and $s will be set to the same value.) Tweaked: Extended the contrib.yo hunk with details about mq. --- Doc/Zsh/contrib.yo | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 3c4fdded0..8bf1a208e 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1652,10 +1652,17 @@ Called in the tt(git) (with tt(stgit) or during rebase or merge), and tt(hg) is generated; the tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq) and tt(stgit) backends are active by default). -This hook gets the names of all applied patches which tt(vcs_info) collected -so far in the opposite order, which means that the first argument is the +The arguments to this hook describe applied patches +in the opposite order, which means that the first argument is the top-most patch and so forth. +When the patches' log messages can be extracted, those are embedded +within each argument after a space, so each argument is of the form +`var(patch-name) var(first line of the log message)', where var(patch-name) +contains no whitespace. The tt(mq) backend passes arguments of +the form `var(patch name)', with possible embedded spaces, but without +extracting the patch's log message. + When setting tt(ret) to non-zero, the string in tt(${hook_com[applied-string]}) will be available as tt(%p) in the tt(patch-format) and tt(nopatch-format) styles. @@ -1669,9 +1676,11 @@ tt(mq)) backend and in tt(quilt) support when the tt(unapplied-string) is generated; the tt(get-unapplied) style must be true. This hook gets the names of all unapplied patches which tt(vcs_info) -collected so far in order, which means that the first argument is +in order, which means that the first argument is the patch next-in-line to be applied and so forth. +The format of each argument is as for tt(gen-applied-string), above. + When setting tt(ret) to non-zero, the string in tt(${hook_com[unapplied-string]}) will be available as tt(%u) in the tt(patch-format) and tt(nopatch-format) styles. -- cgit 1.4.1