Re: [PATCH 2/3] Move unsigned long option parsing out of pack-objects.c

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

Re: [PATCH 2/3] Move unsigned long option parsing out of pack-objects.c

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

Junio C Hamano [off-list ref] writes:
Except for the minor nits above, I think this is a good change.
Oh, I forgot to mention one thing.  I am not sure if this should be
called ULONG.  "unsigned long"-ness is not the most important part
of this thing from the end-user's point of view, and also from the
point of view of the programmer who supports end-users by using this
new feature.

It is "unlike OPT_INTEGER, the user can specify it as a human
readble scaled quantity" that is the reason to use this new thing.
I think we discussed to introduce OPT_HUMINT (HUM stands for HUMAN,
obviously) or some name like that a few years ago to do exactly
this, but that is not a great name, either.

I was tempted to suggest a name that has "size" in it, but because
places that we may conceivably want to use it in the future would be
to specify:

 - sizes, e.g. "split the packfiles into 4.3G chunks".

 - counts, e.g. "show me the most recent 2k commits".

 - bandwidth, e.g. "limit the transfer to consume at most 2M bps".

which is not limited to size, it is not a very good idea, either.

OPT_SCALED_ULONG(), or something with "scaled" in its name, perhaps?

Re: [PATCH 2/3] Move unsigned long option parsing out of pack-objects.c

From: Jakub Narębski <hidden>
Date: 2016-06-15 23:05:25

W dniu 2015-06-19 o 20:39, Junio C Hamano pisze:
Junio C Hamano [off-list ref] writes:
quoted
Except for the minor nits above, I think this is a good change.
Oh, I forgot to mention one thing.  I am not sure if this should be
called ULONG.  "unsigned long"-ness is not the most important part
of this thing from the end-user's point of view, and also from the
point of view of the programmer who supports end-users by using this
new feature.

It is "unlike OPT_INTEGER, the user can specify it as a human
readble scaled quantity" that is the reason to use this new thing.
I think we discussed to introduce OPT_HUMINT (HUM stands for HUMAN,
obviously) or some name like that a few years ago to do exactly
this, but that is not a great name, either.
On the output side it is often called --human-readable (e.g. du(1)),
I don't know how it is called on input side (e.g. in 'dd' and friends).
I was tempted to suggest a name that has "size" in it, but because
places that we may conceivably want to use it in the future would be
to specify:

 - sizes, e.g. "split the packfiles into 4.3G chunks".

 - counts, e.g. "show me the most recent 2k commits".

 - bandwidth, e.g. "limit the transfer to consume at most 2M bps".

which is not limited to size, it is not a very good idea, either.

OPT_SCALED_ULONG(), or something with "scaled" in its name, perhaps?
OPT_HUMAN_READABLE_INTEGER() is probably out as too long? ;-P

-- 
Jakub Narębski

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