Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:55

Karthik Nayak [off-list ref] writes:
From: Karthik Nayak <redacted>

Add support for %(objectname:size=X) where X is a number.
This will print the first X characters of an objectname.
The minimum value for X is 5. Hence any value lesser than
5 will default to 5 characters.
Is the reason why you do not call this "abbrev" because you are
allowing it to truncate to a non-unique prefix?

If so, wouldn't it make more sense to treat this kind of string
function in a way very similar to your earlier "padright"?  I.e.
"%(maxwidth:5)%(objectname)" or something?

If not, and if this is really an abbrev, then it makes sense to make
it specific to the objectname, e.g. "%(objectname:abbrev=7)".

Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

From: Karthik Nayak <hidden>
Date: 2016-06-15 23:05:55

On Tue, Jul 28, 2015 at 9:13 PM, Junio C Hamano [off-list ref] wrote:
Karthik Nayak [off-list ref] writes:
quoted
From: Karthik Nayak <redacted>

Add support for %(objectname:size=X) where X is a number.
This will print the first X characters of an objectname.
The minimum value for X is 5. Hence any value lesser than
5 will default to 5 characters.
Is the reason why you do not call this "abbrev" because you are
allowing it to truncate to a non-unique prefix?

If so, wouldn't it make more sense to treat this kind of string
function in a way very similar to your earlier "padright"?  I.e.
"%(maxwidth:5)%(objectname)" or something?

If not, and if this is really an abbrev, then it makes sense to make
it specific to the objectname, e.g. "%(objectname:abbrev=7)".
It is finding unique abbrev, I just named size as it was smaller. But
abbrev seems better, will rename, thanks :)


-- 
Regards,
Karthik Nayak
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help