git/builtin
Michael S. Tsirkin 30e12b924b patch-id: make it stable against hunk reordering
Patch id changes if users reorder file diffs that make up a patch.

As the result is functionally equivalent, a different patch id is
surprising to many users.
In particular, reordering files using diff -O is helpful to make patches
more readable (e.g. API header diff before implementation diff).

Add an option to change patch-id behaviour making it stable against
these kinds of patch change:
calculate SHA1 hash for each hunk separately and sum all hashes
(using a symmetrical sum) to get patch id

We use a 20byte sum and not xor - since xor would give 0 output
for patches that have two identical diffs, which isn't all that
unlikely (e.g. append the same line in two places).

The new behaviour is enabled
- when patchid.stable is true
- when --stable flag is present

Using a new flag --unstable or setting patchid.stable to false force
the historical behaviour.

In the documentation, clarify that patch ID can now be a sum of hashes,
not a hash.
Document how command line and config options affect the
behaviour.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-10 13:09:24 -07:00
..
2014-01-10 10:33:03 -08:00
2013-12-17 12:02:44 -08:00
2014-01-10 10:33:11 -08:00
2014-01-17 12:21:20 -08:00
2013-12-17 12:02:44 -08:00
2014-01-17 12:21:20 -08:00
2014-01-17 12:21:20 -08:00
2013-12-30 12:27:01 -08:00
2014-01-17 12:21:20 -08:00
2013-10-23 13:21:31 -07:00
2013-09-09 14:36:15 -07:00
2014-01-27 10:44:59 -08:00
2014-01-17 12:21:20 -08:00
2013-12-27 14:57:50 -08:00
2014-01-17 12:21:20 -08:00
2013-12-17 12:02:44 -08:00
2013-07-15 10:56:07 -07:00
2014-01-17 12:21:20 -08:00
2013-09-09 14:36:15 -07:00