diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-04-27 21:15:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-10 13:09:24 -0700 |
commit | 30e12b924b57b15e707f1749f2e5af15f1c7fe09 (patch) | |
tree | b1b51fe49bb067dd3d50c1ebd4dc26a3272283ab /alloc.c | |
parent | test doc: test_write_lines does not split its arguments (diff) | |
download | tgif-30e12b924b57b15e707f1749f2e5af15f1c7fe09.tar.xz |
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>
Diffstat (limited to 'alloc.c')
0 files changed, 0 insertions, 0 deletions