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

Re: [BUG] String equal when compared, processed differently via //



Even this doesn't work:

gitcmd=( git log --max-count=2
--pretty=format:'<<<<<%h>>>>><<<<<%s>>>>><<<<<%d>>>>><<<<<%cr>>>>><<<<<%an>>>>>'
--abbrev-commit )
gitout=( "${gitout[@]//(#b)<<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>>/${match[1]}
${(q-)match[2]}} >${match[3]}< ${(q-)match[4]} ${match[5]}" )


Example outputs (the same repos):
<<<<<15f1acd>>>>><<<<<Updated README.md>>>>><<<<< (HEAD -> master,
origin/master)>>>>><<<<<4 days ago>>>>><<<<<Sebastian Gniazdowski>>>>>
<<<<<0280384>>>>><<<<<Information on source of
*foo*~^*bar*>>>>><<<<<>>>>><<<<<4 days ago>>>>><<<<<Sebastian
Gniazdowski>>>>>
15f1acd 'Updated README.md'
0280384 'Information on source of *foo*~^*bar*' >< '4 days ago'
Sebastian Gniazdowski

<<<<<e6d9a0e>>>>><<<<<A stub for uizcm, with binding (^O^U)>>>>><<<<<
(HEAD -> master)>>>>><<<<<3 hours ago>>>>><<<<<Sebastian
Gniazdowski>>>>>
<<<<<feb4624>>>>><<<<<myctags: Message about recompilation
request>>>>><<<<< (origin/master)>>>>><<<<<3 hours
ago>>>>><<<<<Sebastian Gniazdowski>>>>>
e6d9a0e 'A stub for uizcm, with binding (^O^U)'
feb4624 'myctags: Message about recompilation request' >
(origin/master)< '3 hours ago' Sebastian Gniazdowski


=====================================

#!/usr/bin/env zsh-5.2

emulate -LR zsh
setopt extendedglob

gitcmd=( git log --max-count=2
--pretty=format:'<<<<<%h>>>>><<<<<%s>>>>><<<<<%d>>>>><<<<<%cr>>>>><<<<<%an>>>>>'
--abbrev-commit )
gitout=( "${(@f)"$( "${gitcmd[@]}" )"}" )

print -rl -- "${gitout[@]}"

gitout=( "${gitout[@]//(#b)<<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>><<<<<(*)>>>>>/${match[1]}
${(q-)match[2]}} >${match[3]}< ${(q-)match[4]} ${match[5]}" )

print -rl -- "${gitout[@]}"

Attachment: minimal2.zsh
Description: Binary data



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