Re: [PATCH v2 01/10] ref-filter: add %(refname:shortalign=X) option
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 13, 2015, 10:51 UTC
- Message-ID
- <CACsJy8D6XOJbVb9LiDmmNuH9UWmyj9BRc0V5GYq-0wwi2uvN0w@mail.gmail.com>
- In-Reply-To
- <CAOLa=ZThDcmM79hL0TUh6+8=NkQBWOWK=Ti+-v+2PCysquw-1w@mail.gmail.com>
On Mon, Jul 13, 2015 at 2:56 AM, Karthik Nayak <karthik.188@gmail.com> wrote:
Show 20 quoted lines
> On Sun, Jul 12, 2015 at 7:17 AM, Duy Nguyen <pclouds@gmail.com> wrote: >> >> I guess if you can have multiple arguments after ':' in an atom, then >> you have wiggle room for future. But it looks like you only accept one >> argument after ':'.. (I only checked the version on 'pu'). Having an >> "alignment atom" to augment the real one (like %< changes the behavior >> of the next placeholder), could also work, but it adds dependency >> between atoms, something I don't think ref-filter.c is ready for. >> > > I was thinking of something on the lines of having a function which right > before printing checks if any "align" option is given to the end of a given > item and aligns it accordingly, this ensures that any item which needs to > have such an option can easily do so. > > https://github.com/KarthikNayak/git/commit/0284320483d6442a6425fc665e740f9f975654a1 > > This is what I came up with, you could have a look and let me know if > you have any > suggestions.
Yeah, pretty close to what I described in the other mail. Now if you make "align" a separate atom, I think it would reduce clutter in populate_value() (my personal opinion is this function looks too messy already) and we can easily add more alignment options in future :)
-- Duy