Support copying of approvals on trivial rebase

It can now be configured that all scores for a label are copied
forward when a new patch set is uploaded that is a trivial rebase.
A new patch set is considered as trivial rebase if the commit message
is the same as in the previous patch set and if it has the same code
delta as the previous patch set. This is the case if the change was
rebased onto a different parent. This can be used to enable sticky
approvals, reducing turn-around for trivial rebases prior to
submitting a change.

This makes it also easier for authors to make trivial edits in the
middle of a patch series, as approvals on later changes in the same
series will be carried forward automatically.

This won't work where there are conflicts in the rebase.
This may allow a bad rebase to be submitted, such as when the author
inverts the order of two commits and messes up setup order, such as
by using a method before it is declared. We can't catch everything
in every change using automated tools.

This change is based on a change from Shawn Pearce that was abandoned
some time ago:
  https://gerrit-review.googlesource.com/34801

All the credits for detecting trivial rebases go to him.

Change-Id: I4768e35b3fcb432e0489bc6e10a7f18a51aafd8d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/Documentation/config-labels.txt b/Documentation/config-labels.txt
index c3e09c4..0e5c27a 100644
--- a/Documentation/config-labels.txt
+++ b/Documentation/config-labels.txt
@@ -236,6 +236,18 @@
 sticky approvals, reducing turn-around for trivial cleanups prior to
 submitting a change.
 
+[[label_copyAllScoresOnTrivialRebase]]
+`label.Label-Name.copyAllScoresOnTrivialRebase`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If true, all scores for the label are copied forward when a new patch
+set is uploaded that is a trivial rebase. A new patch set is considered
+as trivial rebase if the commit message is the same as in the previous
+patch set and if it has the same code delta as the previous patch set.
+This is the case if the change was rebased onto a different parent.
+This can be used to enable sticky approvals, reducing turn-around for
+trivial rebases prior to submitting a change. Defaults to false.
+
 [[label_canOverride]]
 `label.Label-Name.canOverride`
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~