162306a36Sopenharmony_ci.. _modifyingpatches:
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciModifying Patches
462306a36Sopenharmony_ci=================
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciIf you are a subsystem or branch maintainer, sometimes you need to slightly
762306a36Sopenharmony_cimodify patches you receive in order to merge them, because the code is not
862306a36Sopenharmony_ciexactly the same in your tree and the submitters'. If you stick strictly to
962306a36Sopenharmony_cirule (c) of the developers certificate of origin, you should ask the submitter
1062306a36Sopenharmony_cito rediff, but this is a totally counter-productive waste of time and energy.
1162306a36Sopenharmony_ciRule (b) allows you to adjust the code, but then it is very impolite to change
1262306a36Sopenharmony_cione submitters code and make him endorse your bugs. To solve this problem, it
1362306a36Sopenharmony_ciis recommended that you add a line between the last Signed-off-by header and
1462306a36Sopenharmony_ciyours, indicating the nature of your changes. While there is nothing mandatory
1562306a36Sopenharmony_ciabout this, it seems like prepending the description with your mail and/or
1662306a36Sopenharmony_ciname, all enclosed in square brackets, is noticeable enough to make it obvious
1762306a36Sopenharmony_cithat you are responsible for last-minute changes. Example::
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci       Signed-off-by: Random J Developer <random@developer.example.org>
2062306a36Sopenharmony_ci       [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h]
2162306a36Sopenharmony_ci       Signed-off-by: Lucky K Maintainer <lucky@maintainer.example.org>
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciThis practice is particularly helpful if you maintain a stable branch and
2462306a36Sopenharmony_ciwant at the same time to credit the author, track changes, merge the fix,
2562306a36Sopenharmony_ciand protect the submitter from complaints. Note that under no circumstances
2662306a36Sopenharmony_cican you change the author's identity (the From header), as it is the one
2762306a36Sopenharmony_ciwhich appears in the changelog.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciSpecial note to back-porters: It seems to be a common and useful practice
3062306a36Sopenharmony_cito insert an indication of the origin of a patch at the top of the commit
3162306a36Sopenharmony_cimessage (just after the subject line) to facilitate tracking. For instance,
3262306a36Sopenharmony_cihere's what we see in a 3.x-stable release::
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci  Date:   Tue Oct 7 07:26:38 2014 -0400
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci    libata: Un-break ATA blacklist
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci    commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciAnd here's what might appear in an older kernel once a patch is backported::
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci    Date:   Tue May 13 22:12:27 2008 +0200
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci        wireless, airo: waitbusy() won't delay
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci        [backport of 2.6 commit b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a]
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciWhatever the format, this information provides a valuable help to people
4962306a36Sopenharmony_citracking your trees, and to people trying to troubleshoot bugs in your
5062306a36Sopenharmony_citree.
51