patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. The
  51. .I email
  52. address, if not
  53. .LR - ,
  54. will be sent notification messages when the patch is applied
  55. or commented on.
  56. .PP
  57. .I Patch/list
  58. displays information about the named patches,
  59. or all currently pending patches if none are specified.
  60. .PP
  61. .I Patch/diff
  62. shows a patch as diffs between the original
  63. source files and the patched source files.
  64. .PP
  65. .I Patch/apply
  66. applies the patch to the current source tree.
  67. It is intended to be run by the Plan 9 developers
  68. with emelie as their root file system.
  69. If the source has changed since the patch was
  70. created,
  71. .I apply
  72. will report the conflict and not change any files.
  73. Before changing any files,
  74. .I patch/apply
  75. makes backup copies of the current source tree's
  76. files. The backups are stored in the patch directory.
  77. .PP
  78. .I Patch/undo
  79. will copy the backups saved by
  80. .I patch/apply
  81. back into the source tree.
  82. It will not restore a backup if the file
  83. being replaced is not byte-identical to the one
  84. created by
  85. .I patch/apply.
  86. .SH EXAMPLES
  87. .PP
  88. Propose a change to
  89. .IR pwd ,
  90. which you have modified locally:
  91. .EX
  92. % patch/create pwd-errors user@host.dom /sys/src/cmd/pwd.c
  93. Fix pwd to print errors to fd 2 rather than 1.
  94. ^D
  95. %
  96. .EE
  97. .PP
  98. Then the developers at Bell Labs run
  99. .EX
  100. patch/diff pwd-errors
  101. .EE
  102. to inspect the change (possibly viewing
  103. .B /n/sources/patch/pwd-errors/pwd.c
  104. to see the larger context).
  105. To make the change, they run
  106. .EX
  107. patch/apply pwd-errors
  108. .EE
  109. Otherwise they run
  110. .EX
  111. % patch/note pwd-errors
  112. Pwd should definitely print errors to fd 1 because ...
  113. ^D
  114. %
  115. .EE
  116. to add a note to the
  117. .B /n/sources/pwd-errors/notes
  118. file.
  119. .SH FILES
  120. .B /n/sources/patch
  121. .SH SOURCE
  122. .B /rc/bin/patch
  123. .SH SEE ALSO
  124. .IR diff (1)