-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Keywords for string, deprecate bin, oct, dec, hex, base #25717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
6246e1e
eb54a4e
a58e640
9b19270
6da9e9d
6721a4f
5e26029
76bb3e7
dd77ce2
571fbf3
bfe6f36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,17 +155,15 @@ function GitShortHash(obj::GitObject) | |
return sid | ||
end | ||
|
||
Base.hex(id::GitHash) = join([hex(i,2) for i in id.val]) | ||
Base.hex(id::GitShortHash) = hex(id.hash)[1:id.len] | ||
|
||
""" | ||
raw(id::GitHash) -> Vector{UInt8} | ||
|
||
Obtain the raw bytes of the [`GitHash`](@ref) as a vector of length $OID_RAWSZ. | ||
""" | ||
raw(id::GitHash) = collect(id.val) | ||
|
||
Base.string(id::AbstractGitHash) = hex(id) | ||
Base.string(id::GitHash) = join([string(i, base = 16, pad = 2) for i in id.val]) | ||
Base.string(id::GitShortHash) = string(id.hash)[1:id.len] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the last discussion was to define There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh no was it I'm so confused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though this makes me think that we should also have the same args to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps best to leave that for another PR though |
||
|
||
Base.show(io::IO, id::GitHash) = print(io, "GitHash(\"$(string(id))\")") | ||
Base.show(io::IO, id::GitShortHash) = print(io, "GitShortHash(\"$(string(id))\")") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.youtube.com/watch?v=2IBqY0jWuZ8