Re: [PATCH v3 0/2] column: disallow negative padding
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 13, 2024, 20:58 UTC
- Message-ID
- <xmqqo7ck3wum.fsf@gitster.g>
- In-Reply-To
- <dc1be818-e793-44f6-98dd-b159e043da28@app.fastmail.com>
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
Show 15 quoted lines
>> There are not many users of OPT_INTEGER, and a quick check gives me >> the impression (maybe wrong...) that many of them do not expect >> negative values. >> >> Maybe we should consider having an OPT_INTEGER that fails if the >> value supplied is negative. Ideally, some kind of opt-in machinery >> could be desirable, I think, for example to include/exclude: >> >> - negative values >> - "0" ( may not be a desired value ) >> - "-1" ( may have some special meaning ) >> - ... >> >> I'll leave the idea here, just in case it inspires someone. Thank >> you.
Interesting.
I wonder if there is a correlation between "never negative" and "handy if it took scale unit (like 2k to mean 2048)"? If so, perhaps we can replace those that use OPT_INTEGER to use OPT_MAGNITUDE instead.
Thanks.