patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 files ...
  8. [
  9. .B <
  10. .I description
  11. ]
  12. .PP
  13. .B patch/list
  14. [
  15. .I name ...
  16. ]
  17. .PP
  18. .B patch/diff
  19. .I name
  20. .PP
  21. .B patch/apply
  22. .I name
  23. .PP
  24. .B patch/undo
  25. .I name
  26. .PP
  27. .B patch/note
  28. .I name
  29. [
  30. .B <
  31. .I note
  32. ]
  33. .SH DESCRIPTION
  34. These scripts are a simple patch submission and tracking system
  35. used to propose additions or changes to Plan 9.
  36. Each patch has a
  37. .I name
  38. (lowercase letters, numbers, dash, dot, and underscore only)
  39. and is stored in
  40. .BI /n/sources/patch/ name \fR.
  41. .PP
  42. .I Patch/create
  43. creates a new patch consisting of the changes to
  44. the listed files, reading
  45. a description of the patch from standard input.
  46. .PP
  47. .I Patch/list
  48. displays information about the named patches,
  49. or all currently pending patches if none are specified.
  50. .PP
  51. .I Patch/diff
  52. shows a patch as diffs between the original
  53. source files and the patched source files.
  54. .PP
  55. .I Patch/apply
  56. applies the patch to the current source tree.
  57. It is intended to be run by the Plan 9 developers
  58. with emelie as their root file system.
  59. If the source has changed since the patch was
  60. created,
  61. .I apply
  62. will report the conflict and not change any files.
  63. Before changing any files,
  64. .I patch/apply
  65. makes backup copies of the current source tree's
  66. files. The backups are stored in the patch directory.
  67. .PP
  68. .I Patch/undo
  69. will copy the backups saved by
  70. .I patch/apply
  71. back into the source tree.
  72. It will not restore a backup if the file
  73. being replaced is not byte-identical to the one
  74. created by
  75. .I patch/apply.
  76. .SH EXAMPLES
  77. .PP
  78. Propose a change to
  79. .IR pwd ,
  80. which you have modified locally:
  81. .EX
  82. % patch/create pwd-errors /sys/src/cmd/pwd.c
  83. Fix pwd to print errors to fd 2 rather than 1.
  84. ^D
  85. %
  86. .EE
  87. .PP
  88. Then the developers at Bell Labs run
  89. .EX
  90. patch/diff pwd-errors
  91. .EE
  92. to inspect the change (possibly viewing
  93. .B /n/sources/patch/pwd-errors/pwd.c
  94. to see the larger context).
  95. To make the change, they run
  96. .EX
  97. patch/apply pwd-errors
  98. .EE
  99. Otherwise they run
  100. .EX
  101. % patch/note pwd-errors
  102. Pwd should definitely print errors to fd 1 because ...
  103. ^D
  104. %
  105. .EE
  106. to add a note to the
  107. .B /n/sources/pwd-errors/notes
  108. file.
  109. .SH FILES
  110. .B /n/sources/patch
  111. .SH SOURCE
  112. .B /rc/bin/patch
  113. .SH SEE ALSO
  114. .IR diff (1)