Jump to: navigation, search

Swift/FormattingSecurityPatches

< Swift
Revision as of 21:33, 4 August 2015 by Notmyname (talk | contribs) (Created page with "= How to format a patch for a security bug = Security bugs cannot be patched and reviewed via gerrit because there is no "private" section for patches in gerrit. Therefore th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to format a patch for a security bug

Security bugs cannot be patched and reviewed via gerrit because there is no "private" section for patches in gerrit. Therefore the patch must be reviewed in the Launchpad bug comments. This page describes how to format the patch so that other reviewers can easily download and review it.

To create the patch

After creating your patch locally on a branch and committing it as one commit ready for review, the following will export the patch to a text file that can be copied around:

 $ git format-patch --stdout HEAD~1 >path/to/local/file.patch`

To review the patch

When a reviewer gets the text file, they can run the command below to apply the patch as a commit (with commit message and appropriate date/author info). Then it can be easily cherry-picked and backported.

 $ git am <~path/to/local/file.patch