patch 2.3 KB

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