procedure
( git_oid_fromstr str)→git_oid?
str:git-oid-string/cvalue
value
The function git_oid_fromstr parses a string into an object ID value, case-insensitively. The string form of an OID must be GIT_OID_HEXSZ characters long, which is enforced by the contract git-oid-string/c .
#<cpointer+offset>
;too shortgit_oid_fromstr: contract violation;
given string is the wrong length
length: 7
expected: 40
given string: "bda0839"
in: the 1st argument of
(-> git-oid-string/c git_oid?)
contract from:
<pkgs>/libgit2/include/oid.rkt
blaming: top-level
(assuming the contract is correct)
at: <pkgs>/libgit2/include/oid.rkt:20:24
;not a hex stringgit_oid_fromstr:
error code: 'GIT_ERROR
error class: 'GIT_ERROR_NONE
procedure
( git_oid_cpy src)→git_oid?
src:git_oid?
#t
procedure
( git_oid_is_zero id)→boolean?
id:git_oid?
#t
#f
"7b70fdd9970245505229ef2127586350aaa8ad38")#t
#t
"ad1b3cc099b788dcb066c56346fc8854e70e821c")#f
procedure
( git_oid_ncmp abn)→(or/c '=#f)
a:git_oid?b:git_oid?
procedure
( git_oid_fmt id)→(and/c string? immutable? )
id:git_oid?
"ad1b3cc099b788dcb066c56346fc8854e70e821c"
procedure
( git_oid_nfmt idn)→(and/c string? immutable? )
id:git_oid?
"ad1b3c"
procedure
( git_oid_pathfmt id)→path?
id:git_oid?
The first two hexidecimal digits of id are used as a directory name, and the remaining 38 digits are treated as a path within that directory.
#<path:40/dc88bde003670bae6df1f0cffb1ffb5d93dee4>
procedure
( git_oid_shorten_new [min-length])→git_oid_shorten?
procedure
( git_oid_shorten? v)→boolean?
v:any/cprocedure
( git_oid_shorten_add shorteneroid-str)→natural-number/c
shortener:git_oid_shorten?oid-str:git-oid-string/c
Calling git_oid_shorten_add with a hex string OID oid-str returns the minimum number of digits needed to distinguish all of the strings that have been supplied to git_oid_shorten_add so far with the same shortener argument. If the OID shortener is created with a non-zero min-length, git_oid_shorten_add will never return a length less than min-length.
Calling git_oid_shorten_add more than once with the same shortener and equivalent oid-str arguments will produce unhelpful results.
Note that, “for performance reasons, [libgit2 imposes] a hard limit of how many OIDs can be added to a single set (around 32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.”
"db775d20c1655c72a95dd40d1a75c0ad4f243461""821ac0038a6b196a93c48182bdde5ac42c6f5b6e""0000000000000000000000000000000000000000""db785d20c1655c72a95dd40d1a75c0ad4f243461""ad1b3cc099c788dcb066c56346fc8854e70e821c"))'("00000000000"
"821ac0038a6"
"ad1b3cc099b"
"ad1b3cc099c"
"db775d20c16"
"db785d20c16")