~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/process/submitting-patches.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/process/submitting-patches.rst (Version linux-6.12-rc7) and /Documentation/process/submitting-patches.rst (Version linux-2.6.32.71)


  1 .. _submittingpatches:                            
  2                                                   
  3 Submitting patches: the essential guide to get    
  4 ==============================================    
  5                                                   
  6 For a person or company who wishes to submit a    
  7 kernel, the process can sometimes be daunting     
  8 with "the system."  This text is a collection     
  9 can greatly increase the chances of your chang    
 10                                                   
 11 This document contains a large number of sugge    
 12 format.  For detailed information on how the k    
 13 works, see Documentation/process/development-p    
 14 Documentation/process/submit-checklist.rst        
 15 for a list of items to check before submitting    
 16 For device tree binding patches, read             
 17 Documentation/devicetree/bindings/submitting-p    
 18                                                   
 19 This documentation assumes that you're using `    
 20 If you're unfamiliar with ``git``, you would b    
 21 use it, it will make your life as a kernel dev    
 22 easier.                                           
 23                                                   
 24 Some subsystems and maintainer trees have addi    
 25 their workflow and expectations, see              
 26 :ref:`Documentation/process/maintainer-handboo    
 27                                                   
 28 Obtain a current source tree                      
 29 ----------------------------                      
 30                                                   
 31 If you do not have a repository with the curre    
 32 ``git`` to obtain one.  You'll want to start w    
 33 which can be grabbed with::                       
 34                                                   
 35   git clone git://git.kernel.org/pub/scm/linux    
 36                                                   
 37 Note, however, that you may not want to develo    
 38 directly.  Most subsystem maintainers run thei    
 39 patches prepared against those trees.  See the    
 40 in the MAINTAINERS file to find that tree, or     
 41 the tree is not listed there.                     
 42                                                   
 43 .. _describe_changes:                             
 44                                                   
 45 Describe your changes                             
 46 ---------------------                             
 47                                                   
 48 Describe your problem.  Whether your patch is     
 49 5000 lines of a new feature, there must be an     
 50 motivated you to do this work.  Convince the r    
 51 problem worth fixing and that it makes sense f    
 52 first paragraph.                                  
 53                                                   
 54 Describe user-visible impact.  Straight up cra    
 55 pretty convincing, but not all bugs are that b    
 56 problem was spotted during code review, descri    
 57 it can have on users.  Keep in mind that the m    
 58 installations run kernels from secondary stabl    
 59 vendor/product-specific trees that cherry-pick    
 60 from upstream, so include anything that could     
 61 downstream: provoking circumstances, excerpts     
 62 descriptions, performance regressions, latency    
 63                                                   
 64 Quantify optimizations and trade-offs.  If you    
 65 performance, memory consumption, stack footpri    
 66 include numbers that back them up.  But also d    
 67 costs.  Optimizations usually aren't free but     
 68 memory, and readability; or, when it comes to     
 69 different workloads.  Describe the expected do    
 70 optimization so that the reviewer can weigh co    
 71                                                   
 72 Once the problem is established, describe what    
 73 about it in technical detail.  It's important     
 74 in plain English for the reviewer to verify th    
 75 as you intend it to.                              
 76                                                   
 77 The maintainer will thank you if you write you    
 78 form which can be easily pulled into Linux's s    
 79 system, ``git``, as a "commit log".  See :ref:    
 80                                                   
 81 Solve only one problem per patch.  If your des    
 82 long, that's a sign that you probably need to     
 83 See :ref:`split_changes`.                         
 84                                                   
 85 When you submit or resubmit a patch or patch s    
 86 complete patch description and justification f    
 87 say that this is version N of the patch (serie    
 88 subsystem maintainer to refer back to earlier     
 89 URLs to find the patch description and put tha    
 90 I.e., the patch (series) and its description s    
 91 This benefits both the maintainers and reviewe    
 92 probably didn't even receive earlier versions     
 93                                                   
 94 Describe your changes in imperative mood, e.g.    
 95 instead of "[This patch] makes xyzzy do frotz"    
 96 to do frotz", as if you are giving orders to t    
 97 its behaviour.                                    
 98                                                   
 99 If you want to refer to a specific commit, don    
100 SHA-1 ID of the commit. Please also include th    
101 the commit, to make it easier for reviewers to    
102 Example::                                         
103                                                   
104         Commit e21d2170f36602ae2708 ("video: r    
105         platform_set_drvdata()") removed the u    
106         platform_set_drvdata(), but left the v    
107         delete it.                                
108                                                   
109 You should also be sure to use at least the fi    
110 SHA-1 ID.  The kernel repository holds a *lot*    
111 collisions with shorter IDs a real possibility    
112 there is no collision with your six-character     
113 change five years from now.                       
114                                                   
115 If related discussions or any other background    
116 can be found on the web, add 'Link:' tags poin    
117 result of some earlier mailing list discussion    
118 web, point to it.                                 
119                                                   
120 When linking to mailing list archives, prefera    
121 message archiver service. To create the link U    
122 ``Message-ID`` header of the message without t    
123 For example::                                     
124                                                   
125     Link: https://lore.kernel.org/30th.anniver    
126                                                   
127 Please check the link to make sure that it is     
128 to the relevant message.                          
129                                                   
130 However, try to make your explanation understa    
131 resources. In addition to giving a URL to a ma    
132 summarize the relevant points of the discussio    
133 patch as submitted.                               
134                                                   
135 In case your patch fixes a bug, use the 'Close    
136 the report in the mailing list archives or a p    
137                                                   
138         Closes: https://example.com/issues/123    
139                                                   
140 Some bug trackers have the ability to close is    
141 commit with such a tag is applied. Some bots m    
142 also track such tags and take certain actions.    
143 invalid URLs are forbidden.                       
144                                                   
145 If your patch fixes a bug in a specific commit    
146 ``git bisect``, please use the 'Fixes:' tag wi    
147 the SHA-1 ID, and the one line summary.  Do no    
148 lines, tags are exempt from the "wrap at 75 co    
149 parsing scripts.  For example::                   
150                                                   
151         Fixes: 54a4f0239f2e ("KVM: MMU: make k    
152                                                   
153 The following ``git config`` settings can be u    
154 outputting the above style in the ``git log``     
155                                                   
156         [core]                                    
157                 abbrev = 12                       
158         [pretty]                                  
159                 fixes = Fixes: %h (\"%s\")        
160                                                   
161 An example call::                                 
162                                                   
163         $ git log -1 --pretty=fixes 54a4f0239f    
164         Fixes: 54a4f0239f2e ("KVM: MMU: make k    
165                                                   
166 .. _split_changes:                                
167                                                   
168 Separate your changes                             
169 ---------------------                             
170                                                   
171 Separate each **logical change** into a separa    
172                                                   
173 For example, if your changes include both bug     
174 enhancements for a single driver, separate tho    
175 or more patches.  If your changes include an A    
176 driver which uses that new API, separate those    
177                                                   
178 On the other hand, if you make a single change    
179 group those changes into a single patch.  Thus    
180 is contained within a single patch.               
181                                                   
182 The point to remember is that each patch shoul    
183 change that can be verified by reviewers.  Eac    
184 on its own merits.                                
185                                                   
186 If one patch depends on another patch in order    
187 complete, that is OK.  Simply note **"this pat    
188 in your patch description.                        
189                                                   
190 When dividing your change into a series of pat    
191 ensure that the kernel builds and runs properl    
192 series.  Developers using ``git bisect`` to tr    
193 splitting your patch series at any point; they    
194 introduce bugs in the middle.                     
195                                                   
196 If you cannot condense your patch set into a s    
197 then only post say 15 or so at a time and wait    
198                                                   
199                                                   
200                                                   
201 Style-check your changes                          
202 ------------------------                          
203                                                   
204 Check your patch for basic style violations, d    
205 found in Documentation/process/coding-style.rs    
206 Failure to do so simply wastes                    
207 the reviewers time and will get your patch rej    
208 without even being read.                          
209                                                   
210 One significant exception is when moving code     
211 another -- in this case you should not modify     
212 the same patch which moves it.  This clearly d    
213 moving the code and your changes.  This greatl    
214 actual differences and allows tools to better     
215 the code itself.                                  
216                                                   
217 Check your patches with the patch style checke    
218 (scripts/checkpatch.pl).  Note, though, that t    
219 viewed as a guide, not as a replacement for hu    
220 looks better with a violation then its probabl    
221                                                   
222 The checker reports at three levels:              
223  - ERROR: things that are very likely to be wr    
224  - WARNING: things requiring careful review       
225  - CHECK: things requiring thought                
226                                                   
227 You should be able to justify all violations t    
228 patch.                                            
229                                                   
230                                                   
231 Select the recipients for your patch              
232 ------------------------------------              
233                                                   
234 You should always copy the appropriate subsyst    
235 any patch to code that they maintain; look thr    
236 source code revision history to see who those     
237 scripts/get_maintainer.pl can be very useful a    
238 patches as arguments to scripts/get_maintainer    
239 maintainer for the subsystem you are working o    
240 (akpm@linux-foundation.org) serves as a mainta    
241                                                   
242 linux-kernel@vger.kernel.org should be used by    
243 volume on that list has caused a number of dev    
244 do not spam unrelated lists and unrelated peop    
245                                                   
246 Many kernel-related lists are hosted at kernel    
247 of them at https://subspace.kernel.org.  There    
248 hosted elsewhere as well, though.                 
249                                                   
250 Linus Torvalds is the final arbiter of all cha    
251 Linux kernel.  His e-mail address is <torvalds@    
252 He gets a lot of e-mail, and, at this point, v    
253 Linus directly, so typically you should do you    
254 sending him e-mail.                               
255                                                   
256 If you have a patch that fixes an exploitable     
257 to security@kernel.org.  For severe bugs, a sh    
258 to allow distributors to get the patch out to     
259 obviously, the patch should not be sent to any    
260 Documentation/process/security-bugs.rst.          
261                                                   
262 Patches that fix a severe bug in a released ke    
263 toward the stable maintainers by putting a lin    
264                                                   
265   Cc: stable@vger.kernel.org                      
266                                                   
267 into the sign-off area of your patch (note, NO    
268 should also read Documentation/process/stable-    
269 in addition to this document.                     
270                                                   
271 If changes affect userland-kernel interfaces,     
272 maintainer (as listed in the MAINTAINERS file)    
273 least a notification of the change, so that so    
274 into the manual pages.  User-space API changes    
275 linux-api@vger.kernel.org.                        
276                                                   
277                                                   
278 No MIME, no links, no compression, no attachme    
279 ----------------------------------------------    
280                                                   
281 Linus and other kernel developers need to be a    
282 on the changes you are submitting.  It is impo    
283 developer to be able to "quote" your changes,     
284 tools, so that they may comment on specific po    
285                                                   
286 For this reason, all patches should be submitt    
287 easiest way to do this is with ``git send-emai    
288 recommended.  An interactive tutorial for ``gi    
289 https://git-send-email.io.                        
290                                                   
291 If you choose not to use ``git send-email``:      
292                                                   
293 .. warning::                                      
294                                                   
295   Be wary of your editor's word-wrap corruptin    
296   if you choose to cut-n-paste your patch.        
297                                                   
298 Do not attach the patch as a MIME attachment,     
299 Many popular e-mail applications will not alwa    
300 attachment as plain text, making it impossible    
301 code.  A MIME attachment also takes Linus a bi    
302 decreasing the likelihood of your MIME-attache    
303                                                   
304 Exception:  If your mailer is mangling patches    
305 you to re-send them using MIME.                   
306                                                   
307 See Documentation/process/email-clients.rst fo    
308 your e-mail client so that it sends your patch    
309                                                   
310 Respond to review comments                        
311 --------------------------                        
312                                                   
313 Your patch will almost certainly get comments     
314 which the patch can be improved, in the form o    
315 respond to those comments; ignoring reviewers     
316 return. You can simply reply to their emails t    
317 comments or questions that do not lead to a co    
318 bring about a comment or changelog entry so th    
319 understands what is going on.                     
320                                                   
321 Be sure to tell the reviewers what changes you    
322 for their time.  Code review is a tiring and t    
323 reviewers sometimes get grumpy.  Even in that     
324 politely and address the problems they have po    
325 version, add a ``patch changelog`` to the cove    
326 explaining difference against previous submiss    
327 :ref:`the_canonical_patch_format`).               
328 Notify people that commented on your patch abo    
329 the patches CC list.                              
330                                                   
331 See Documentation/process/email-clients.rst fo    
332 clients and mailing list etiquette.               
333                                                   
334 .. _interleaved_replies:                          
335                                                   
336 Use trimmed interleaved replies in email discu    
337 ----------------------------------------------    
338 Top-posting is strongly discouraged in Linux k    
339 discussions. Interleaved (or "inline") replies    
340 easier to follow. For more details see:           
341 https://en.wikipedia.org/wiki/Posting_style#In    
342                                                   
343 As is frequently quoted on the mailing list::     
344                                                   
345   A: http://en.wikipedia.org/wiki/Top_post        
346   Q: Were do I find info about this thing call    
347   A: Because it messes up the order in which p    
348   Q: Why is top-posting such a bad thing?         
349   A: Top-posting.                                 
350   Q: What is the most annoying thing in e-mail    
351                                                   
352 Similarly, please trim all unneeded quotations    
353 to your reply. This makes responses easier to     
354 space. For more details see: http://daringfire    
355                                                   
356   A: No.                                          
357   Q: Should I include quotations after my repl    
358                                                   
359 .. _resend_reminders:                             
360                                                   
361 Don't get discouraged - or impatient              
362 ------------------------------------              
363                                                   
364 After you have submitted your change, be patie    
365 busy people and may not get to your patch righ    
366                                                   
367 Once upon a time, patches used to disappear in    
368 but the development process works more smoothl    
369 receive comments within a few weeks (typically    
370 happen, make sure that you have sent your patc    
371 Wait for a minimum of one week before resubmit    
372 - possibly longer during busy times like merge    
373                                                   
374 It's also ok to resend the patch or the patch     
375 weeks with the word "RESEND" added to the subj    
376                                                   
377    [PATCH Vx RESEND] sub/sys: Condensed patch     
378                                                   
379 Don't add "RESEND" when you are submitting a m    
380 patch or patch series - "RESEND" only applies     
381 patch or patch series which have not been modi    
382 previous submission.                              
383                                                   
384                                                   
385 Include PATCH in the subject                      
386 -----------------------------                     
387                                                   
388 Due to high e-mail traffic to Linus, and to li    
389 convention to prefix your subject line with [P    
390 and other kernel developers more easily distin    
391 e-mail discussions.                               
392                                                   
393 ``git send-email`` will do this for you automa    
394                                                   
395                                                   
396 Sign your work - the Developer's Certificate o    
397 ----------------------------------------------    
398                                                   
399 To improve tracking of who did what, especiall    
400 percolate to their final resting place in the     
401 layers of maintainers, we've introduced a "sig    
402 patches that are being emailed around.            
403                                                   
404 The sign-off is a simple line at the end of th    
405 patch, which certifies that you wrote it or ot    
406 pass it on as an open-source patch.  The rules    
407 can certify the below:                            
408                                                   
409 Developer's Certificate of Origin 1.1             
410 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
411                                                   
412 By making a contribution to this project, I ce    
413                                                   
414         (a) The contribution was created in wh    
415             have the right to submit it under     
416             indicated in the file; or             
417                                                   
418         (b) The contribution is based upon pre    
419             of my knowledge, is covered under     
420             license and I have the right under    
421             work with modifications, whether c    
422             by me, under the same open source     
423             permitted to submit under a differ    
424             in the file; or                       
425                                                   
426         (c) The contribution was provided dire    
427             person who certified (a), (b) or (    
428             it.                                   
429                                                   
430         (d) I understand and agree that this p    
431             are public and that a record of th    
432             personal information I submit with    
433             maintained indefinitely and may be    
434             this project or the open source li    
435                                                   
436 then you just add a line saying::                 
437                                                   
438         Signed-off-by: Random J Developer <rand    
439                                                   
440 using a known identity (sorry, no anonymous co    
441 This will be done for you automatically if you    
442 Reverts should also include "Signed-off-by". `    
443 for you.                                          
444                                                   
445 Some people also put extra tags at the end.  T    
446 now, but you can do this to mark internal comp    
447 point out some special detail about the sign-o    
448                                                   
449 Any further SoBs (Signed-off-by:'s) following     
450 people handling and transporting the patch, bu    
451 development. SoB chains should reflect the **r    
452 as it was propagated to the maintainers and ul    
453 the first SoB entry signalling primary authors    
454                                                   
455                                                   
456 When to use Acked-by:, Cc:, and Co-developed-b    
457 ----------------------------------------------    
458                                                   
459 The Signed-off-by: tag indicates that the sign    
460 development of the patch, or that he/she was i    
461                                                   
462 If a person was not directly involved in the p    
463 patch but wishes to signify and record their a    
464 ask to have an Acked-by: line added to the pat    
465                                                   
466 Acked-by: is often used by the maintainer of t    
467 maintainer neither contributed to nor forwarde    
468                                                   
469 Acked-by: is not as formal as Signed-off-by:.     
470 has at least reviewed the patch and has indica    
471 mergers will sometimes manually convert an ack    
472 into an Acked-by: (but note that it is usually    
473 explicit ack).                                    
474                                                   
475 Acked-by: does not necessarily indicate acknow    
476 For example, if a patch affects multiple subsy    
477 one subsystem maintainer then this usually ind    
478 the part which affects that maintainer's code.    
479 When in doubt people should refer to the origi    
480 list archives.                                    
481                                                   
482 If a person has had the opportunity to comment    
483 provided such comments, you may optionally add    
484 This is the only tag which might be added with    
485 person it names - but it should indicate that     
486 patch.  This tag documents that potentially in    
487 have been included in the discussion.             
488                                                   
489 Co-developed-by: states that the patch was co-    
490 it is used to give attribution to co-authors (    
491 attributed by the From: tag) when several peop    
492 Co-developed-by: denotes authorship, every Co-    
493 followed by a Signed-off-by: of the associated    
494 procedure applies, i.e. the ordering of Signed    
495 chronological history of the patch insofar as     
496 the author is attributed via From: or Co-devel    
497 Signed-off-by: must always be that of the deve    
498                                                   
499 Note, the From: tag is optional when the From:    
500 email) listed in the From: line of the email h    
501                                                   
502 Example of a patch submitted by the From: auth    
503                                                   
504         <changelog>                               
505                                                   
506         Co-developed-by: First Co-Author <first    
507         Signed-off-by: First Co-Author <first@c    
508         Co-developed-by: Second Co-Author <seco    
509         Signed-off-by: Second Co-Author <second    
510         Signed-off-by: From Author <from@author    
511                                                   
512 Example of a patch submitted by a Co-developed    
513                                                   
514         From: From Author <from@author.example.    
515                                                   
516         <changelog>                               
517                                                   
518         Co-developed-by: Random Co-Author <rand    
519         Signed-off-by: Random Co-Author <random    
520         Signed-off-by: From Author <from@author    
521         Co-developed-by: Submitting Co-Author <    
522         Signed-off-by: Submitting Co-Author <su    
523                                                   
524                                                   
525 Using Reported-by:, Tested-by:, Reviewed-by:,     
526 ----------------------------------------------    
527                                                   
528 The Reported-by tag gives credit to people who    
529 hopefully inspires them to help us again in th    
530 bugs; please do not use it to credit feature r    
531 followed by a Closes: tag pointing to the repo    
532 available on the web. The Link: tag can be use    
533 fixes a part of the issue(s) being reported. P    
534 reported in private, then ask for permission f    
535 tag.                                              
536                                                   
537 A Tested-by: tag indicates that the patch has     
538 some environment) by the person named.  This t    
539 some testing has been performed, provides a me    
540 future patches, and ensures credit for the tes    
541                                                   
542 Reviewed-by:, instead, indicates that the patc    
543 acceptable according to the Reviewer's Stateme    
544                                                   
545 Reviewer's statement of oversight                 
546 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
547                                                   
548 By offering my Reviewed-by: tag, I state that:    
549                                                   
550          (a) I have carried out a technical re    
551              evaluate its appropriateness and     
552              the mainline kernel.                 
553                                                   
554          (b) Any problems, concerns, or questi    
555              have been communicated back to th    
556              with the submitter's response to     
557                                                   
558          (c) While there may be things that co    
559              submission, I believe that it is,    
560              worthwhile modification to the ke    
561              issues which would argue against     
562                                                   
563          (d) While I have reviewed the patch a    
564              do not (unless explicitly stated     
565              warranties or guarantees that it     
566              purpose or function properly in a    
567                                                   
568 A Reviewed-by tag is a statement of opinion th    
569 appropriate modification of the kernel without    
570 technical issues.  Any interested reviewer (wh    
571 offer a Reviewed-by tag for a patch.  This tag    
572 reviewers and to inform maintainers of the deg    
573 done on the patch.  Reviewed-by: tags, when su    
574 understand the subject area and to perform tho    
575 increase the likelihood of your patch getting     
576                                                   
577 Both Tested-by and Reviewed-by tags, once rece    
578 or reviewer, should be added by author to the     
579 next versions.  However if the patch has chang    
580 version, these tags might not be applicable an    
581 Usually removal of someone's Tested-by or Revi    
582 in the patch changelog (after the '---' separa    
583                                                   
584 A Suggested-by: tag indicates that the patch i    
585 named and ensures credit to the person for the    
586 tag should not be added without the reporter's    
587 idea was not posted in a public forum. That sa    
588 idea reporters, they will, hopefully, be inspi    
589 future.                                           
590                                                   
591 A Fixes: tag indicates that the patch fixes an    
592 is used to make it easy to determine where a b    
593 review a bug fix. This tag also assists the st    
594 which stable kernel versions should receive yo    
595 method for indicating a bug fixed by the patch    
596 for more details.                                 
597                                                   
598 Note: Attaching a Fixes: tag does not subvert     
599 process nor the requirement to Cc: stable@vger    
600 patch candidates. For more information, please    
601 Documentation/process/stable-kernel-rules.rst.    
602                                                   
603 .. _the_canonical_patch_format:                   
604                                                   
605 The canonical patch format                        
606 --------------------------                        
607                                                   
608 This section describes how the patch itself sh    
609 that, if you have your patches stored in a ``g    
610 formatting can be had with ``git format-patch`    
611 the necessary text, though, so read the instru    
612                                                   
613 The canonical patch subject line is::             
614                                                   
615     Subject: [PATCH 001/123] subsystem: summar    
616                                                   
617 The canonical patch message body contains the     
618                                                   
619   - A ``from`` line specifying the patch autho    
620     line (only needed if the person sending th    
621                                                   
622   - The body of the explanation, line wrapped     
623     be copied to the permanent changelog to de    
624                                                   
625   - An empty line.                                
626                                                   
627   - The ``Signed-off-by:`` lines, described ab    
628     also go in the changelog.                     
629                                                   
630   - A marker line containing simply ``---``.      
631                                                   
632   - Any additional comments not suitable for t    
633                                                   
634   - The actual patch (``diff`` output).           
635                                                   
636 The Subject line format makes it very easy to     
637 alphabetically by subject line - pretty much a    
638 support that - since because the sequence numb    
639 the numerical and alphabetic sort is the same.    
640                                                   
641 The ``subsystem`` in the email's Subject shoul    
642 area or subsystem of the kernel is being patch    
643                                                   
644 The ``summary phrase`` in the email's Subject     
645 describe the patch which that email contains.     
646 phrase`` should not be a filename.  Do not use    
647 phrase`` for every patch in a whole patch seri    
648 series`` is an ordered sequence of multiple, r    
649                                                   
650 Bear in mind that the ``summary phrase`` of yo    
651 globally-unique identifier for that patch.  It    
652 into the ``git`` changelog.  The ``summary phr    
653 developer discussions which refer to the patch    
654 google for the ``summary phrase`` to read disc    
655 patch.  It will also be the only thing that pe    
656 when, two or three months later, they are goin    
657 thousands of patches using tools such as ``git    
658 --oneline``.                                      
659                                                   
660 For these reasons, the ``summary`` must be no     
661 characters, and it must describe both what the    
662 as why the patch might be necessary.  It is ch    
663 succinct and descriptive, but that is what a w    
664 should do.                                        
665                                                   
666 The ``summary phrase`` may be prefixed by tags    
667 brackets: "Subject: [PATCH <tag>...] <summary     
668 not considered part of the summary phrase, but    
669 should be treated.  Common tags might include     
670 the multiple versions of the patch have been s    
671 comments (i.e., "v1, v2, v3"), or "RFC" to ind    
672 comments.                                         
673                                                   
674 If there are four patches in a patch series th    
675 be numbered like this: 1/4, 2/4, 3/4, 4/4. Thi    
676 understand the order in which the patches shou    
677 they have reviewed or applied all of the patch    
678                                                   
679 Here are some good example Subjects::             
680                                                   
681     Subject: [PATCH 2/5] ext2: improve scalabi    
682     Subject: [PATCH v2 01/27] x86: fix eflags     
683     Subject: [PATCH v2] sub/sys: Condensed pat    
684     Subject: [PATCH v2 M/N] sub/sys: Condensed    
685                                                   
686 The ``from`` line must be the very first line     
687 and has the form:                                 
688                                                   
689         From: Patch Author <author@example.com>    
690                                                   
691 The ``from`` line specifies who will be credit    
692 patch in the permanent changelog.  If the ``fr    
693 then the ``From:`` line from the email header     
694 the patch author in the changelog.                
695                                                   
696 The explanation body will be committed to the     
697 changelog, so should make sense to a competent    
698 forgotten the immediate details of the discuss    
699 this patch. Including symptoms of the failure     
700 (kernel log messages, oops messages, etc.) are    
701 people who might be searching the commit logs     
702 patch. The text should be written in such deta    
703 weeks, months or even years later, it can give    
704 details to grasp the reasoning for **why** the    
705                                                   
706 If a patch fixes a compile failure, it may not    
707 _all_ of the compile failures; just enough tha    
708 someone searching for the patch can find it. A    
709 phrase``, it is important to be both succinct     
710                                                   
711 The ``---`` marker line serves the essential p    
712 patch handling tools where the changelog messa    
713                                                   
714 One good use for the additional comments after    
715 for a ``diffstat``, to show what files have ch    
716 inserted and deleted lines per file. A ``diffs    
717 on bigger patches. If you are going to include    
718 ``---`` marker, please use ``diffstat`` option    
719 filenames are listed from the top of the kerne    
720 use too much horizontal space (easily fit in 8    
721 indentation). (``git`` generates appropriate d    
722                                                   
723 Other comments relevant only to the moment or     
724 suitable for the permanent changelog, should a    
725 example of such comments might be ``patch chan    
726 what has changed between the v1 and v2 version    
727                                                   
728 Please put this information **after** the ``--    
729 the changelog from the rest of the patch. The     
730 not part of the changelog which gets committed    
731 additional information for the reviewers. If i    
732 commit tags, it needs manual interaction to re    
733 the separator line, it gets automatically stri    
734 patch::                                           
735                                                   
736   <commit message>                                
737   ...                                             
738   Signed-off-by: Author <author@mail>              
739   ---                                             
740   V2 -> V3: Removed redundant helper function     
741   V1 -> V2: Cleaned up coding style and addres    
742                                                   
743   path/to/file | 5+++--                           
744   ...                                             
745                                                   
746 See more details on the proper patch format in    
747 references.                                       
748                                                   
749 .. _backtraces:                                   
750                                                   
751 Backtraces in commit messages                     
752 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     
753                                                   
754 Backtraces help document the call chain leadin    
755 not all backtraces are helpful. For example, e    
756 unique and obvious. Copying the full dmesg out    
757 adds distracting information like timestamps,     
758 stack dumps.                                      
759                                                   
760 Therefore, the most useful backtraces should d    
761 information from the dump, which makes it easi    
762 issue. Here is an example of a well-trimmed ba    
763                                                   
764   unchecked MSR access error: WRMSR to 0xd51 (    
765   at rIP: 0xffffffffae059994 (native_write_msr    
766   Call Trace:                                     
767   mba_wrmsr                                       
768   update_domains                                  
769   rdtgroup_mkdir                                  
770                                                   
771 .. _explicit_in_reply_to:                         
772                                                   
773 Explicit In-Reply-To headers                      
774 ----------------------------                      
775                                                   
776 It can be helpful to manually add In-Reply-To:    
777 (e.g., when using ``git send-email``) to assoc    
778 previous relevant discussion, e.g. to link a b    
779 the bug report.  However, for a multi-patch se    
780 best to avoid using In-Reply-To: to link to ol    
781 series.  This way multiple versions of the pat    
782 unmanageable forest of references in email cli    
783 helpful, you can use the https://lore.kernel.o    
784 the cover email text) to link to an earlier ve    
785                                                   
786                                                   
787 Providing base tree information                   
788 -------------------------------                   
789                                                   
790 When other developers receive your patches and    
791 it is absolutely necessary for them to know wh    
792 commit/branch your work applies on, considerin    
793 maintainer trees present nowadays. Note again     
794 MAINTAINERS file explained above.                 
795                                                   
796 This is even more important for automated CI p    
797 run a series of tests in order to establish th    
798 submission before the maintainer starts the re    
799                                                   
800 If you are using ``git format-patch`` to gener    
801 automatically include the base tree informatio    
802 using the ``--base`` flag. The easiest and mos    
803 this option is with topical branches::            
804                                                   
805     $ git checkout -t -b my-topical-branch mas    
806     Branch 'my-topical-branch' set up to track    
807     Switched to a new branch 'my-topical-branc    
808                                                   
809     [perform your edits and commits]              
810                                                   
811     $ git format-patch --base=auto --cover-let    
812     outgoing/0000-cover-letter.patch              
813     outgoing/0001-First-Commit.patch              
814     outgoing/...                                  
815                                                   
816 When you open ``outgoing/0000-cover-letter.pat    
817 notice that it will have the ``base-commit:``     
818 bottom, which provides the reviewer and the CI    
819 to properly perform ``git am`` without worryin    
820                                                   
821     $ git checkout -b patch-review [base-commi    
822     Switched to a new branch 'patch-review'       
823     $ git am patches.mbox                         
824     Applying: First Commit                        
825     Applying: ...                                 
826                                                   
827 Please see ``man git-format-patch`` for more i    
828 option.                                           
829                                                   
830 .. note::                                         
831                                                   
832     The ``--base`` feature was introduced in g    
833                                                   
834 If you are not using git to format your patche    
835 the same ``base-commit`` trailer to indicate t    
836 on which your work is based. You should add it    
837 letter or in the first patch of the series and    
838 either below the ``---`` line or at the very b    
839 content, right before your email signature.       
840                                                   
841 Make sure that base commit is in an official m    
842 and not in some internal, accessible only to y    
843 would be worthless.                               
844                                                   
845 Tooling                                           
846 -------                                           
847                                                   
848 Many of the technical aspects of this process     
849 b4, documented at <https://b4.docs.kernel.org/    
850 help with things like tracking dependencies, r    
851 with formatting and sending mails.                
852                                                   
853 References                                        
854 ----------                                        
855                                                   
856 Andrew Morton, "The perfect patch" (tpp).         
857   <https://www.ozlabs.org/~akpm/stuff/tpp.txt>    
858                                                   
859 Jeff Garzik, "Linux kernel patch submission fo    
860   <https://web.archive.org/web/20180829112450/    
861                                                   
862 Greg Kroah-Hartman, "How to piss off a kernel     
863   <http://www.kroah.com/log/linux/maintainer.h    
864                                                   
865   <http://www.kroah.com/log/linux/maintainer-0    
866                                                   
867   <http://www.kroah.com/log/linux/maintainer-0    
868                                                   
869   <http://www.kroah.com/log/linux/maintainer-0    
870                                                   
871   <http://www.kroah.com/log/linux/maintainer-0    
872                                                   
873   <http://www.kroah.com/log/linux/maintainer-0    
874                                                   
875 Kernel Documentation/process/coding-style.rst     
876                                                   
877 Linus Torvalds's mail on the canonical patch f    
878   <https://lore.kernel.org/r/Pine.LNX.4.58.0504    
879                                                   
880 Andi Kleen, "On submitting kernel patches"        
881   Some strategies to get difficult or controve    
882                                                   
883   http://halobates.de/on-submitting-patches.pd    
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php