Re: [PATCH v2 03/13] hex: introduce functions to print arbitrary hashes

2018-10-17 Thread brian m. carlson
On Tue, Oct 16, 2018 at 10:54:23AM +0900, Junio C Hamano wrote: > Even though in hex.c I see mixture of *_algo and *_algop helper > functions, I see only "algo" variants above. Is it our official > stance to use primarily the integer index into the algo array when > specifying the hash, and when

Re: [PATCH v2 03/13] hex: introduce functions to print arbitrary hashes

2018-10-15 Thread Junio C Hamano
"brian m. carlson" writes: > diff --git a/cache.h b/cache.h > index d508f3d4f8..a13d14ce0a 100644 > --- a/cache.h > +++ b/cache.h > @@ -1361,9 +1361,9 @@ extern int get_oid_hex(const char *hex, struct > object_id *sha1); > extern int hex_to_bytes(unsigned char *binary, const char *hex, size_t

[PATCH v2 03/13] hex: introduce functions to print arbitrary hashes

2018-10-14 Thread brian m. carlson
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.