patch 3.3 KB

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