patch 2.1 KB

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