Follow-up Comment #9, bug #68908 (group groff): [comment #8 comment #8:] > And "git describe" doesn't know what sorts of changes can > impact formatter behavior and which can't. And I question > the value of trying to teach it how to decide that.
I don't see anything in git needing to change.
But whatever mechanism _uses_ the git data to populate the numeric .Y register
needs to stop reading that data when it hits nonnumeric values, else the code
is not adhering to the documented behavior. I have no quarrel with anything
git does, or with anything being returned by the --version option, the output
of which is meant to be read by humans.
>> This suggests that the underlying structural issue is that "number"
>> registers are not stored in numeric data types.
>
> Truly numerically valued registers are. But that doesn't
> matter because _all_ register interpolations take place in
> the context of an input stream, which is a character sequence.
My point was that if there were an int (or compatibly typed) C++ variable
holding the value of .Y, it couldn't return anything but digits upon
interpolation. But that was a bit of conjecture on my part: for all I know,
there's no corresponding C++ variable at all, and every .Y interpolation
accesses git (or something git has populated). But to be within spec, this
access should stop reading when it encounters nonnumeric content, as strtol()
or one of its ilk would do. It needn't be any more conceptually complicated
than a printf("%d", atoi(git_thing)): make it a number, then spit it back out
as text. No need to use strtol()'s second parameter to check whether anything
appeared after the number; such data does not constitute an error condition.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68908>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
