From: Karthik Nayak Date: Tue, 10 Jan 2017 08:49:34 +0000 (+0530) Subject: ref-filter: implement %(if), %(then), and %(else) atoms X-Git-Tag: v2.13.0-rc0~174^2~20 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c58492d4347fb6ee68fbb59b40e34ffde4dc2389?hp=c58492d4347fb6ee68fbb59b40e34ffde4dc2389 ref-filter: implement %(if), %(then), and %(else) atoms Implement %(if), %(then) and %(else) atoms. Used as %(if)...%(then)...%(end) or %(if)...%(then)...%(else)...%(end). If the format string between %(if) and %(then) expands to an empty string, or to only whitespaces, then the whole %(if)...%(end) expands to the string following %(then). Otherwise, it expands to the string following %(else), if any. Nesting of this construct is possible. This is in preparation for porting over `git branch -l` to use ref-filter APIs for printing. Add documentation and tests regarding the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano ---