diff options
Diffstat (limited to 'Documentation/SubmittingPatches')
| -rw-r--r-- | Documentation/SubmittingPatches | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 7f43b040311e..237d54c44bc5 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
| @@ -301,8 +301,84 @@ now, but you can do this to mark internal company procedures or just | |||
| 301 | point out some special detail about the sign-off. | 301 | point out some special detail about the sign-off. |
| 302 | 302 | ||
| 303 | 303 | ||
| 304 | 12) The canonical patch format | ||
| 304 | 305 | ||
| 305 | 12) More references for submitting patches | 306 | The canonical patch subject line is: |
| 307 | |||
| 308 | Subject: [PATCH 001/123] subsystem: summary phrase | ||
| 309 | |||
| 310 | The canonical patch message body contains the following: | ||
| 311 | |||
| 312 | - A "from" line specifying the patch author. | ||
| 313 | |||
| 314 | - An empty line. | ||
| 315 | |||
| 316 | - The body of the explanation, which will be copied to the | ||
| 317 | permanent changelog to describe this patch. | ||
| 318 | |||
| 319 | - The "Signed-off-by:" lines, described above, which will | ||
| 320 | also go in the changelog. | ||
| 321 | |||
| 322 | - A marker line containing simply "---". | ||
| 323 | |||
| 324 | - Any additional comments not suitable for the changelog. | ||
| 325 | |||
| 326 | - The actual patch (diff output). | ||
| 327 | |||
| 328 | The Subject line format makes it very easy to sort the emails | ||
| 329 | alphabetically by subject line - pretty much any email reader will | ||
| 330 | support that - since because the sequence number is zero-padded, | ||
| 331 | the numerical and alphabetic sort is the same. | ||
| 332 | |||
| 333 | The "subsystem" in the email's Subject should identify which | ||
| 334 | area or subsystem of the kernel is being patched. | ||
| 335 | |||
| 336 | The "summary phrase" in the email's Subject should concisely | ||
| 337 | describe the patch which that email contains. The "summary | ||
| 338 | phrase" should not be a filename. Do not use the same "summary | ||
| 339 | phrase" for every patch in a whole patch series. | ||
| 340 | |||
| 341 | Bear in mind that the "summary phrase" of your email becomes | ||
| 342 | a globally-unique identifier for that patch. It propagates | ||
| 343 | all the way into the git changelog. The "summary phrase" may | ||
| 344 | later be used in developer discussions which refer to the patch. | ||
| 345 | People will want to google for the "summary phrase" to read | ||
| 346 | discussion regarding that patch. | ||
| 347 | |||
| 348 | A couple of example Subjects: | ||
| 349 | |||
| 350 | Subject: [patch 2/5] ext2: improve scalability of bitmap searching | ||
| 351 | Subject: [PATCHv2 001/207] x86: fix eflags tracking | ||
| 352 | |||
| 353 | The "from" line must be the very first line in the message body, | ||
| 354 | and has the form: | ||
| 355 | |||
| 356 | From: Original Author <author@example.com> | ||
| 357 | |||
| 358 | The "from" line specifies who will be credited as the author of the | ||
| 359 | patch in the permanent changelog. If the "from" line is missing, | ||
| 360 | then the "From:" line from the email header will be used to determine | ||
| 361 | the patch author in the changelog. | ||
| 362 | |||
| 363 | The explanation body will be committed to the permanent source | ||
| 364 | changelog, so should make sense to a competent reader who has long | ||
| 365 | since forgotten the immediate details of the discussion that might | ||
| 366 | have led to this patch. | ||
| 367 | |||
| 368 | The "---" marker line serves the essential purpose of marking for patch | ||
| 369 | handling tools where the changelog message ends. | ||
| 370 | |||
| 371 | One good use for the additional comments after the "---" marker is for | ||
| 372 | a diffstat, to show what files have changed, and the number of inserted | ||
| 373 | and deleted lines per file. A diffstat is especially useful on bigger | ||
| 374 | patches. Other comments relevant only to the moment or the maintainer, | ||
| 375 | not suitable for the permanent changelog, should also go here. | ||
| 376 | |||
| 377 | See more details on the proper patch format in the following | ||
| 378 | references. | ||
| 379 | |||
| 380 | |||
| 381 | 13) More references for submitting patches | ||
| 306 | 382 | ||
| 307 | Andrew Morton, "The perfect patch" (tpp). | 383 | Andrew Morton, "The perfect patch" (tpp). |
| 308 | <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt> | 384 | <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt> |
| @@ -310,6 +386,14 @@ Andrew Morton, "The perfect patch" (tpp). | |||
| 310 | Jeff Garzik, "Linux kernel patch submission format." | 386 | Jeff Garzik, "Linux kernel patch submission format." |
| 311 | <http://linux.yyz.us/patch-format.html> | 387 | <http://linux.yyz.us/patch-format.html> |
| 312 | 388 | ||
| 389 | Greg KH, "How to piss off a kernel subsystem maintainer" | ||
| 390 | <http://www.kroah.com/log/2005/03/31/> | ||
| 391 | |||
| 392 | Kernel Documentation/CodingStyle | ||
| 393 | <http://sosdg.org/~coywolf/lxr/source/Documentation/CodingStyle> | ||
| 394 | |||
| 395 | Linus Torvald's mail on the canonical patch format: | ||
| 396 | <http://lkml.org/lkml/2005/4/7/183> | ||
| 313 | 397 | ||
| 314 | 398 | ||
| 315 | ----------------------------------- | 399 | ----------------------------------- |
