signature: distinguish +0000 and -0000 UTC offsets - #4408
Merged
Conversation
pks-t
requested changes
Nov 12, 2017
pks-t
left a comment
Member
There was a problem hiding this comment.
I don't really mind about that trailing newline. But the commit message could be improved in two things:
- we don't use trailer-lines in commit messages
- we try to prepend the subsystem to the subject line, like e.g. "signature: distinguish positive and negative UTC offsets"
Otherwise this looks fine to me, thanks a lot!
| git_signature_free((git_signature *)with_neg_zero); | ||
| git_signature_free((git_signature *)with_pos_zero); | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Really nitpicky: there's a trailing newline here
Git considers '-0000' a valid offset for signature lines. They need to be treated as _not_ equal to a '+0000' signature offset. Parsing a signature line stores the offset in a signed integer which does not distinguish between `+0` and `-0`. This patch adds an additional flag `sign` to the `git_time` in the `signature` object which is populated with the sign of the offset. In addition to exposing this information to the user, this information is also used to compare signatures. /cc @pks-t @ethomson
hkleynhans
force-pushed
the
pos_neg_zero_offset_sig
branch
from
November 12, 2017 12:03
eb78b42 to
f063daf
Compare
Member
|
Thanks a lot for your fixup! |
Author
|
👍 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Git considers '-0000' a valid offset for signature lines. They need to
be treated as not equal to a '+0000' signature offset. Parsing a
signature line stores the offset in a signed integer which does not
distinguish between
+0and-0.This patch adds an additional flag
signto thegit_timein thesignatureobject which is populated with the sign of the offset. Inaddition to exposing this information to the user, this information is
also used to compare signatures.
/cc @pks-t @ethomson