Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-03 Thread brian m. carlson
On Mon, May 01, 2017 at 06:27:58PM -0400, Jeff King wrote: > If you have 40 hex digits, then you have 20 hex pairs. But delimiting > them all takes only 19 slashes, since they only go in between pairs[1]. > > So the fully expanded formula is: > > GIT_MAX_HEXSZ + (1) actual hex byt

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jonathan Tan
On 05/01/2017 03:27 PM, Jeff King wrote: On Mon, May 01, 2017 at 03:07:22PM -0700, Jonathan Tan wrote: @@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout( static uintmax_t change_note_fanout(struct tree_entry *root, unsigned char fanout) { - char hex_sha1[40],

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 03:07:22PM -0700, Jonathan Tan wrote: > > @@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout( > > static uintmax_t change_note_fanout(struct tree_entry *root, > > unsigned char fanout) > > { > > - char hex_sha1[40], path[60]; > > - return do_cha

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: @@ -391,10 +391,8 @@ static void write_branch_report(FILE *rpt, struct branch *b) fputc('\n', rpt); fprintf(rpt, " tip commit : %s\n", oid_to_hex(&b->oid)); - fprintf(rpt, " old tree: %s\n", - oid_to_hex(

[PATCH v2 11/53] fast-import: convert to struct object_id

2017-04-30 Thread brian m. carlson
Convert the remaining parts of fast-import.c to use struct object_id. Convert several instances of get_sha1_hex to parse_oid_hex to avoid needing to specify constants. Convert other hardcoded values to named constants. Finally, use the is_empty_tree_oid function instead of a direct comparison aga