Re: [PATCH 09/23] pack v4: commit object encoding

2013-09-04 Thread Nicolas Pitre
On Tue, 3 Sep 2013, Duy Nguyen wrote: On Tue, Sep 3, 2013 at 1:30 PM, Nicolas Pitre n...@fluxnic.net wrote: On Tue, 3 Sep 2013, Duy Nguyen wrote: On Tue, Aug 27, 2013 at 11:25 AM, Nicolas Pitre n...@fluxnic.net wrote: This goes as follows: - Tree reference: either variable length

Re: [PATCH 09/23] pack v4: commit object encoding

2013-09-03 Thread Nicolas Pitre
On Tue, 3 Sep 2013, Duy Nguyen wrote: On Tue, Aug 27, 2013 at 11:25 AM, Nicolas Pitre n...@fluxnic.net wrote: This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table or the literal SHA1 prefixed by 0 (see add_sha1_ref()). -

Re: [PATCH 09/23] pack v4: commit object encoding

2013-09-03 Thread Duy Nguyen
On Tue, Sep 3, 2013 at 1:30 PM, Nicolas Pitre n...@fluxnic.net wrote: On Tue, 3 Sep 2013, Duy Nguyen wrote: On Tue, Aug 27, 2013 at 11:25 AM, Nicolas Pitre n...@fluxnic.net wrote: This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table

Re: [PATCH 09/23] pack v4: commit object encoding

2013-09-02 Thread Duy Nguyen
On Tue, Aug 27, 2013 at 11:25 AM, Nicolas Pitre n...@fluxnic.net wrote: This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table or the literal SHA1 prefixed by 0 (see add_sha1_ref()). - Parent count: variable length encoding of the number

Re: [PATCH 09/23] pack v4: commit object encoding

2013-08-27 Thread Junio C Hamano
Nicolas Pitre n...@fluxnic.net writes: This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table or the literal SHA1 prefixed by 0 (see add_sha1_ref()). - Parent count: variable length encoding of the number of parents. This is normally

Re: [PATCH 09/23] pack v4: commit object encoding

2013-08-27 Thread Nicolas Pitre
On Tue, 27 Aug 2013, Junio C Hamano wrote: Nicolas Pitre n...@fluxnic.net writes: This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table or the literal SHA1 prefixed by 0 (see add_sha1_ref()). - Parent count: variable length

Re: [PATCH 09/23] pack v4: commit object encoding

2013-08-27 Thread Nicolas Pitre
On Tue, 27 Aug 2013, Junio C Hamano wrote: Nicolas Pitre n...@fluxnic.net writes: + /* parse the tree line */ + if (in + 46 = tail || memcmp(in, tree , 5) || in[45] != '\n') + goto bad_data; + if (get_sha1_hex(in + 5, sha1) 0) + goto bad_data; Is this

Re: [PATCH 09/23] pack v4: commit object encoding

2013-08-27 Thread Junio C Hamano
Nicolas Pitre n...@fluxnic.net writes: On Tue, 27 Aug 2013, Junio C Hamano wrote: Nicolas Pitre n...@fluxnic.net writes: + /* parse the tree line */ + if (in + 46 = tail || memcmp(in, tree , 5) || in[45] != '\n') + goto bad_data; + if (get_sha1_hex(in + 5, sha1) 0) +

Re: [PATCH 09/23] pack v4: commit object encoding

2013-08-27 Thread Nicolas Pitre
On Tue, 27 Aug 2013, Junio C Hamano wrote: Nicolas Pitre n...@fluxnic.net writes: On Tue, 27 Aug 2013, Junio C Hamano wrote: Nicolas Pitre n...@fluxnic.net writes: +/* parse the tree line */ +if (in + 46 = tail || memcmp(in, tree , 5) || in[45] != '\n') +

[PATCH 09/23] pack v4: commit object encoding

2013-08-26 Thread Nicolas Pitre
This goes as follows: - Tree reference: either variable length encoding of the index into the SHA1 table or the literal SHA1 prefixed by 0 (see add_sha1_ref()). - Parent count: variable length encoding of the number of parents. This is normally going to occupy a single byte but doesn't