Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2015, 15:44 UTC
- Message-ID
- <xmqqy4gyukag.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <vpqd1yap8ml.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 10 quoted lines
>> For the current code %(if:empty)%(align)%(end)%(then)Empty%(else)Not Empty%(end) >> would print non-empty, I guess the documentation holds in that case. >> Not sure if we require it to print non-empty. > > You don't want the %(if) condition to depend on whether > --shell/--python/... is used. Since %(if:empty)%(align)%(end)%(then) > holds when you don't use --shell, you also want it to hold when you > quote. IOW, you should check for emptyness before (or actually without) > doing the quoting. I guess this is what you're doing, and if so, I think > it's "The Right Thing".
I agree that %(align)%(end) should expand to empty and %(if:empty)...%(then) should look at that empty string without quoting. So
%(if:empty)%(align)%(end)%(then)Empty%(else)Not Empty%(end)
should give "Empty"; otherwise the code is buggy, I think.