Re: [PATCH 04/18] diff: avoid fixed-size buffer for patch-ids

2017-03-28 Thread Jeff King
On Tue, Mar 28, 2017 at 03:46:18PM -0400, Jeff King wrote: > As a result, the data we feed to the sha1 computation may be > truncated, and it's possible that a commit with a very long > filename could erroneously collide in the patch-id space > with another commit. For instance, if one commit modi

[PATCH 04/18] diff: avoid fixed-size buffer for patch-ids

2017-03-28 Thread Jeff King
To generate a patch id, we format the diff header into a fixed-size buffer, and then feed the result to our sha1 computation. The fixed buffer has size '4*PATH_MAX + 20', which in theory accomodates the four filenames plus some extra data. Except: 1. The filenames may not be constrained to PATH_