Re: [RFC/PATCH 1/9] ref-filter: add %(refname:lalignX) option
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jun 28, 2015, 06:59 UTC
- Message-ID
- <CAOLa=ZRdwoVrEh5igD-T5CPSOzOF8+k4pF6PE99wCqQo_q6+6g@mail.gmail.com>
- In-Reply-To
- <CAP8UFD1gT_2RKYc1vvBO9goGwPzFxhu9uMan5+cLO7eWxwwB_w@mail.gmail.com>
Hey Christian, On Sun, Jun 28, 2015 at 1:32 AM, Christian Couder <christian.couder@gmail.com> wrote:
Show 18 quoted lines
>
> After thinking about such code, I wonder if it would be better to
> support %(refname:lalign=X) instead of %(refname:lalignX).
>
> The reason why it might be interesting to require an = sign between
> "align" and the number X is that if we later want to introduce another
> option with a name that starts with "lalign", for example
> %(refname:lalignall=X) that would truncate the refname if it is bigger
> than X), we might be more backward compatible with old git versions
> that implement %(refname:lalign=X) but not %(refname:lalignall=X).
>
> We will be more backward compatible because the above call to
> starts_with() would probably be something like:
>
> if (starts_with(formatp, "lalign=")) {
>
> which means that old git versions would ignore something like "lalignall=X".
>Good point! I agree with what you said, including an "=" sign would mean more compatibility in the future as we could have lalign* options. Will change this, thanks.
-- Regards, Karthik Nayak