Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 10:06:10AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Wed, Sep 16, 2015 at 10:15:02AM +0200, Johannes Schindelin wrote: > > > >> Maybe we should stick to the established practice of the many, many > >> reentrant POSIX functions following the *_r() naming co

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-16 Thread Junio C Hamano
Jeff King writes: > On Wed, Sep 16, 2015 at 10:15:02AM +0200, Johannes Schindelin wrote: > >> Maybe we should stick to the established practice of the many, many >> reentrant POSIX functions following the *_r() naming convention? I.e. >> the reentrant version of localtime() is called localtime_r(

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 10:15:02AM +0200, Johannes Schindelin wrote: > Maybe we should stick to the established practice of the many, many > reentrant POSIX functions following the *_r() naming convention? I.e. > the reentrant version of localtime() is called localtime_r(), the > reentrant version

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-16 Thread Johannes Schindelin
Hi Junio, Jeff & Ramsay, On 2015-09-16 03:32, Junio C Hamano wrote: > Jeff King writes: > >>> Hmm, I haven't read any other patches yet (including those which use these >>> new '_to' functions), but I can't help feeling they should be named >>> something >>> like 'sha1_to_hex_str()' and 'find_u

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-15 Thread Junio C Hamano
Jeff King writes: >> Hmm, I haven't read any other patches yet (including those which use these >> new '_to' functions), but I can't help feeling they should be named something >> like 'sha1_to_hex_str()' and 'find_unique_abbrev_str()' instead. i.e. I >> don't get >> the '_to' thing - not that

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-15 Thread Jeff King
On Tue, Sep 15, 2015 at 05:55:55PM +0100, Ramsay Jones wrote: > On 15/09/15 16:26, Jeff King wrote: > > The sha1_to_hex and find_unique_abbrev functions always > > write into reusable static buffers. There are a few problems > > with this: > > > > - future calls overwrite our result. This is esp

Re: [PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-15 Thread Ramsay Jones
On 15/09/15 16:26, Jeff King wrote: > The sha1_to_hex and find_unique_abbrev functions always > write into reusable static buffers. There are a few problems > with this: > > - future calls overwrite our result. This is especially > annoying with find_unique_abbrev, which does not have a >

[PATCH 08/67] add reentrant variants of sha1_to_hex and find_unique_abbrev

2015-09-15 Thread Jeff King
The sha1_to_hex and find_unique_abbrev functions always write into reusable static buffers. There are a few problems with this: - future calls overwrite our result. This is especially annoying with find_unique_abbrev, which does not have a ring of buffers, so you cannot even printf() a r