Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 26, 2015, 11:54 UTC
- Message-ID
- <vpqd1yap8ml.fsf@anie.imag.fr>
- In-Reply-To
- <CAOLa=ZS=Mtz0ny0tUWRBY0vfAgiRzaszeF0m_pxnK3+VGn1eVg@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 38 quoted lines
> On Tue, Aug 25, 2015 at 4:05 AM, Junio C Hamano <gitster@pobox.com> wrote: >> Junio C Hamano <gitster@pobox.com> writes: >> >>> Karthik Nayak <karthik.188@gmail.com> writes: >>> >>>> On Mon, Aug 24, 2015 at 10:57 PM, Junio C Hamano <gitster@pobox.com> wrote: >>>>> Karthik Nayak <karthik.188@gmail.com> writes: >>>>> ... >>>>>> + performed. If used with '--quote' everything in between %(align:..) >>>>>> + and %(end) is quoted. >>>> ... >>>> I might have misunderstood you, But based on the discussion held here >>>> (thread.gmane.org/gmane.comp.version-control.git/276140) >>>> I thought we wanted everything inside the %(align) .... %(end) atoms >>>> to be quoted. >>> >>> Perhaps I misunderstood your intention in the doc. >>> >>> I took "everything in between %(align:...) and %(end) is quoted" to >>> mean that >>> >>> %(if:empty)%(align)%(end)%(then)Empty%(else)Not Empty%(end) >>> >>> can never satisfy %(if:empty), because %(align)%(end) would expand >>> to a string that has two single-quotes, that is not an empty string. >>> >>> If that is not what would happen in the "branch --list" enhancement, >>> then the proposed behaviour is good, but the above documentation would >>> need to be updated when it happens, I think. It at least is misleading. >> >> OK, now I checked the code, and I _think_ the recursive logic is >> doing the right thing (modulo minor nits on comment-vs-code >> discrepancy and code structure I sent separately). >> > > 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".
-- Matthieu Moy http://www-verimag.imag.fr/~moy/