Re: [PATCH v10 05/13] ref-filter: implement an `align` atom

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 12, 2015 at 10:43 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Karthik Nayak <karthik.188@xxxxxxxxx> writes:
>
>> On Wed, Aug 12, 2015 at 12:22 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>
>>> Minor nits on the design.  %(align:<width>[,<position>]) would let
>>> us write %(align:16)...%(end) and use the "default position", which
>>> may be beneficial if one kind of alignment is prevalent (I guess all
>>> the internal users left-align?)  %(align:<position>,<width>) forces
>>> users to spell both out all the time.
>>>
>>
>> Isn't that better? I mean It sets a format which the others eventually
>> can follow
>> %(atom:suboption,value).
>> For example: %(objectname:abbrev,size)
>
> No, I do not think it is better.  First of all, the similarity you
> are perceiving does not exist.  For 'objectname:abbrev', the 'size'
> is a property of the 'abbrev'.  For 'align:left', the 'width' is not
> a property of the position.  It is a property given to 'align'
> (i.e. you have this many display columns to work with).
>
> Also, if there are ways other than 'abbrev' that '8' could affect
> the way how %(objectname) is modified, then it should be spelled as
> %(objectname:abbrev=8).  To specify two modification magics, each of
> which takes a number, the user would say e.g.
>
>     %(objectname:abbrev=8,magic=4)
>
> The syntax %(objectname:abbrev,size) would not allow you to extend
> it nicely---you would end up with %(objectname:abbrev,8,magic,4) or
> something silly like that.
>
> Seeing your %(objectname:abbrev,size), I'd imagine that you are
> assuming that you will never allow any magic other than 'abbrev'
> that takes a number to %(objectname).  And under that assumption
> %(objectname:8) would be a short-hand for %(objectname:8,abbrev).
>

I never thought about this, thanks for explaining.

> And that would be following %(align:8).  Both 'left' (implied
> default) and '8' are instructing 'align' what to do.
>

Will follow this. :)

-- 
Regards,
Karthik Nayak
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]