1
0
mirror of https://github.com/git/git.git synced 2025-03-15 18:32:18 +00:00
git/Documentation
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-02-14 11:35:04 -08:00
2014-01-17 12:21:20 -08:00
2013-07-22 16:06:48 -07:00
2013-02-14 10:29:01 -08:00
2013-09-04 12:23:25 -07:00
2013-09-09 14:50:36 -07:00
2013-12-17 11:46:32 -08:00
2013-10-23 13:21:31 -07:00
2011-09-06 11:42:12 -07:00
2013-05-29 14:23:04 -07:00
2013-10-18 13:50:12 -07:00
2011-03-11 10:59:16 -05:00
2013-04-12 12:00:52 -07:00
2014-02-14 11:35:04 -08:00
2014-02-07 11:55:12 -08:00
2014-01-27 10:44:27 -08:00
2013-06-09 13:45:32 -07:00
2013-07-22 16:06:48 -07:00