Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-28 Thread Junio C Hamano
Derrick Stolee writes: > diff --git a/commit-graph.h b/commit-graph.h > new file mode 100644 > index 000..dc8c73a > --- /dev/null > +++ b/commit-graph.h > @@ -0,0 +1,7 @@ > +#ifndef COMMIT_GRAPH_H > +#define COMMIT_GRAPH_H > + > +extern char *write_commit_graph(const char

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-26 Thread SZEDER Gábor
On Mon, Feb 19, 2018 at 7:53 PM, Derrick Stolee wrote: > +static int if_packed_commit_add_to_list(const struct object_id *oid, > + struct packed_git *pack, > + uint32_t pos, > +

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-23 Thread Derrick Stolee
On 2/23/2018 2:30 PM, Junio C Hamano wrote: Derrick Stolee writes: jt/binsearch-with-fanout introduces one when there is a 256-entry fanout table (not the case here). The bsearch() method in search.h (and used in pack-write.c:need_large_offset) does not return the

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-23 Thread Junio C Hamano
Junio C Hamano writes: >> I think the current name makes the following call very clear: > > It is still a strange name nevertheless. Sorry for simply repeating "strange" without spelling out why in the previous message. This certainly is subjective and depends on your

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-23 Thread Junio C Hamano
Derrick Stolee writes: > jt/binsearch-with-fanout introduces one when there is a 256-entry > fanout table (not the case here). > > The bsearch() method in search.h (and used in > pack-write.c:need_large_offset) does not return the _position_ of a > found element. > > Neither of

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-23 Thread Derrick Stolee
On 2/20/2018 5:57 PM, Junio C Hamano wrote: Derrick Stolee writes: +#define GRAPH_OID_VERSION_SHA1 1 +#define GRAPH_OID_LEN_SHA1 20 This hardcoded 20 on the right hand side of this #define is probably problematic. Unless you are planning to possibly store truncated hash

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-20 Thread Junio C Hamano
Derrick Stolee writes: > +#define GRAPH_OID_VERSION_SHA1 1 > +#define GRAPH_OID_LEN_SHA1 20 This hardcoded 20 on the right hand side of this #define is probably problematic. Unless you are planning to possibly store truncated hash value for some future hash algorithm,

[PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-19 Thread Derrick Stolee
Teach Git to write a commit graph file by checking all packed objects to see if they are commits, then store the file in the given object directory. Signed-off-by: Derrick Stolee --- Makefile | 1 + commit-graph.c | 370