]> git.ipfire.org Git - thirdparty/git.git/commit
hex: introduce functions to print arbitrary hashes
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 14 Nov 2018 04:09:29 +0000 (04:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Nov 2018 07:54:52 +0000 (16:54 +0900)
commit47edb649973cf5cd5f7066b5c936b330f78d687b
tree4ac6a70f25929ac9cc1d3507e67bdff6957ee855
parent2f90b9d9b4ba1f8e79318853301e8ef19ca02681
hex: introduce functions to print arbitrary hashes

Currently, we have functions that turn an arbitrary SHA-1 value or an
object ID into hex format, either using a static buffer or with a
user-provided buffer.  Add variants of these functions that can handle
an arbitrary hash algorithm, specified by constant.  Update the
documentation as well.

While we're at it, remove the "extern" declaration from this family of
functions, since it's not needed and our style now recommends against
it.

We use the variant taking the algorithm structure pointer as the
internal variant, since taking an algorithm pointer is the easiest way
to handle all of the variants in use.

Note that we maintain these functions because there are hashes which
must change based on the hash algorithm in use but are not object IDs
(such as pack checksums).

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
hex.c