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

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

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> On Wed, Aug 12, 2015 at 10:43 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> ...
>> %(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)
>> ...
>> And that would be following %(align:8).  Both 'left' (implied
>> default) and '8' are instructing 'align' what to do.
>
> Will follow this. :)

I think the most generic way to think about this is to consider that
the most fully spelled form of align would be this:

	%(align:width=12,position=left)

And another rule you would have is that the user is allowed to omit
"<attr>=" when it is obvious from its value.  For "align", 'left'
can only possibly be the value for 'position' and similarly '12' for
'width'.  That is why the "objectname" example says "abbrev=8", and
not "abbrev,8", because from the value of "8" without the attribute
name, you cannot tell if the user meant abbrev=8 or magic=8.

That '"<attr>=" can be omitted' rule makes both of these valid
constructs:

	%(align:12,left) %(align:left,12)

Moreover, if you make "left aligned" the default behaviour when
position is not specified, you can make %(align:12) the shortest way
to spell the same thing.  Note that I said "if you make"; I do not
offhand know if all the internal callers of this mechanism your
updates to "branch -l" and "tag -l" would want left aligned output
(if so, that is one argument to favor making left-aligned the
implicit default; if not, it may be better to require the position
always specified).


--
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]