Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-23 Thread Junio C Hamano
Jeff King writes: > I suspect we need more than just the "is_empty" query. At least for the > blob case, we do hashcpy() it into a struct (which should eventually > become oidcpy). The empty-tree case even more so, as we pass it to > random functions like lookup_tree(). > > Our EMPTY_TREE_SHA1_BI

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Jacob Keller
On Fri, Aug 19, 2016 at 2:14 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Jacob Keller writes: >> >>> Is there a reason for that? I've found that .field = value is safer >>> because it ensures that you don't end up initializing the wrong >>> values? Or is it a compatibility thing? >>

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Junio C Hamano
Junio C Hamano writes: > Jacob Keller writes: > >> Is there a reason for that? I've found that .field = value is safer >> because it ensures that you don't end up initializing the wrong >> values? Or is it a compatibility thing? > > Yes. That was a bit too terse. The answers to all three quest

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Jeff King
On Fri, Aug 19, 2016 at 01:31:27PM -0700, Junio C Hamano wrote: > Jacob Keller writes: > > > From: Jacob Keller > > > > Add an empty_tree_oid object which can be used in place of > > EMPTY_TREE_SHA1_BIN_LITERAL for code which is being converted to struct > > object_id. > > How widely do you en

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Junio C Hamano
Jacob Keller writes: > Is there a reason for that? I've found that .field = value is safer > because it ensures that you don't end up initializing the wrong > values? Or is it a compatibility thing? Yes. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message t

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Jacob Keller
On Fri, Aug 19, 2016 at 1:31 PM, Junio C Hamano wrote: > Jacob Keller writes: > >> From: Jacob Keller >> >> Add an empty_tree_oid object which can be used in place of >> EMPTY_TREE_SHA1_BIN_LITERAL for code which is being converted to struct >> object_id. > > How widely do you envision the users

Re: [PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-19 Thread Junio C Hamano
Jacob Keller writes: > From: Jacob Keller > > Add an empty_tree_oid object which can be used in place of > EMPTY_TREE_SHA1_BIN_LITERAL for code which is being converted to struct > object_id. How widely do you envision the users of this symbol would be spread across the entire codebase? I am d

[PATCH v8 7/8] cache: add empty_tree_oid object

2016-08-18 Thread Jacob Keller
From: Jacob Keller Add an empty_tree_oid object which can be used in place of EMPTY_TREE_SHA1_BIN_LITERAL for code which is being converted to struct object_id. Signed-off-by: Jacob Keller --- cache.h | 2 ++ sha1_file.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/cache.h b/cac