type source =
| From of Hash.t | To notice than an user-defined source exists for the delta-ification. |
| None | To notice than no user-defined source exists. |
The type of a source.
val make : Hash.t -> ?name:string -> ?preferred:bool -> ?delta:source -> Git.Pack.Kind.t -> int64 -> t
make hash ?name ?preferred ?delta kind length
returns a new entry when:
hash
corresponds to the unique ID of the git object.name
corresponds to the optional name of the git object. For aTree
or aBlob
, the client should notice the given name (to optimize the delta-ification).preferred
notices to the delta-ification algorithm to prefer to use this entry as a source.delta
notices an existing user specified source for the entry (and the delta-ification algorithm will use it).kind
corresponds to the kind of the object.length
corresponds to the real inflated length of the object.
val kind : t -> Git.Pack.Kind.t
val preferred : t -> bool
val length : t -> int64
The comparison function for the entry t
. It returns 0
when a
equal b
. It returns a negative integer if a
is less than b
and a positive integer when a
is greater than b
. This function is used to sort a list of entries with the Git heuristic and produce an optimal delta-ification.
According to Git, it's a lexicographic sort by the Kind
.t, the optional name of the entry (hashed by hash
) and sorted by size (larger to smaller).