patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. .TH PATCH 1
  2. .SH NAME
  3. patch \- simple patch creation and tracking system
  4. .SH SYNOPSIS
  5. .B patch/create
  6. .I name
  7. .I email
  8. .I files ...
  9. [
  10. .B <
  11. .I description
  12. ]
  13. .PP
  14. .B patch/list
  15. [
  16. .I name ...
  17. ]
  18. .PP
  19. .B patch/diff
  20. .I name
  21. .PP
  22. .B patch/apply
  23. .I name
  24. .PP
  25. .B patch/undo
  26. .I name
  27. .PP
  28. .B patch/note
  29. .I name
  30. [
  31. .B <
  32. .I note
  33. ]
  34. .SH DESCRIPTION
  35. These scripts are a simple patch submission and tracking system
  36. used to propose additions or changes to Plan 9.
  37. There is no guarantee that any patch will be accepted, nor
  38. that it will be accepted verbatim.
  39. Each patch has a
  40. .I name
  41. (lowercase letters, numbers, dash, dot, and underscore only)
  42. and is stored in
  43. .BI /n/sources/patch/ name.
  44. .PP
  45. .I Patch/create
  46. creates a new patch consisting of the changes to
  47. the listed text files from the distribution, reading
  48. a description of the patch from standard input:
  49. please provide an explanation of what the change is supposed to do,
  50. some context, and a rationale for the change.
  51. Please do not submit binary files.
  52. Test data or pointers to same to verify that the fix works are also welcome.
  53. When sending a patch, follow these guidelines:
  54. .IP • 3
  55. Before preparing the patch, run
  56. .I replica/pull
  57. and base your patch on current distribution source code.
  58. .IP •
  59. If this is a bug fix, explain the bug clearly.
  60. Don't assume the bug is obvious from the fix.
  61. .IP •
  62. If this is a new feature, explain it clearly.
  63. Don't assume it is obvious from the change.
  64. .IP •
  65. Make the new code look as much like the old code as possible:
  66. don't make gratuitous changes, and do follow the style of the old code.
  67. See
  68. .IR style (6)
  69. for the canonical Plan 9 coding style.
  70. .IP •
  71. If your patch changes externally-visible behaviour,
  72. update the manual page.
  73. .PP
  74. The
  75. .I email
  76. address, if not
  77. .LR - ,
  78. will be sent notification messages when the patch is applied, rejected,
  79. or commented on.
  80. If rejected, the e-mail will contain a note explaining why and
  81. probably listing suggested changes and encouraging you to resubmit.
  82. .PP
  83. .I Patch/list
  84. displays information about the named patches,
  85. or all currently pending patches if none are specified.
  86. .PP
  87. .I Patch/diff
  88. shows a patch as diffs between the original
  89. source files and the patched source files.
  90. .PP
  91. .I Patch/apply
  92. applies the patch to the current source tree.
  93. It is intended to be run by the Plan 9 developers with
  94. .B pie
  95. as their root file system.
  96. If the source has changed since the patch was
  97. created,
  98. .I apply
  99. will report the conflict and not change any files.
  100. Before changing any files,
  101. .I patch/apply
  102. makes backup copies of the current source tree's
  103. files. The backups are stored in the patch directory.
  104. .PP
  105. .I Patch/undo
  106. will copy the backups saved by
  107. .I patch/apply
  108. back into the source tree.
  109. It will not restore a backup if the file
  110. being replaced is not byte-identical to the one
  111. created by
  112. .I patch/apply.
  113. .SH EXAMPLES
  114. Propose a change to
  115. .IR pwd ,
  116. which you have modified locally:
  117. .IP
  118. .EX
  119. % patch/create pwd-errors user@host.dom /sys/src/cmd/pwd.c
  120. Fix pwd to print errors to fd 2 rather than 1.
  121. ^D
  122. %
  123. .EE
  124. .PP
  125. Then the developers at Bell Labs run
  126. .IP
  127. .EX
  128. patch/diff pwd-errors
  129. .EE
  130. .PP
  131. to inspect the change (possibly viewing
  132. .B /n/sources/patch/pwd-errors/pwd.c
  133. to see the larger context).
  134. To make the change, they run
  135. .IP
  136. .EX
  137. patch/apply pwd-errors
  138. .EE
  139. .LP
  140. Otherwise they run
  141. .IP
  142. .EX
  143. % patch/note pwd-errors
  144. Pwd should definitely print errors to fd 1 because ...
  145. ^D
  146. %
  147. .EE
  148. .PP
  149. to add a note to the
  150. .B /n/sources/pwd-errors/notes
  151. file.
  152. .SH FILES
  153. .B /n/sources/patch
  154. .SH SOURCE
  155. .B /rc/bin/patch
  156. .SH SEE ALSO
  157. .IR diff (1)
  158. .br
  159. .B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute