Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — Plan9 4th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

diff(1)

PATCH(1)

NAME

patch − simple patch creation and tracking system

SYNOPSIS

­patch/create ­name ­files ...  [ ­< ­description ]

­patch/list [ ­name ...  ]

­patch/diff ­name

­patch/apply ­name

­patch/undo ­name

­patch/note ­name [ ­< ­note ]

DESCRIPTION

These scripts are a simple patch submission and tracking system used to propose additions or changes to Plan 9.  Each patch has a ­name and is stored in /n/sources/patch/name.

­Patch/create creates a new patch consisting of the changes to the listed files, reading a description of the patch from standard input. 

­Patch/list displays information about the named patches, or all currently pending patches if none are specified. 

­Patch/diff shows a patch as diffs between the original source files and the patched source files. 

­Patch/apply applies the patch to the current source tree.  It is intended to be run by the Plan 9 developers with emelie as their root file system.  If the source has changed since the patch was created, ­apply will report the conflict and not change any files.  Before changing any files, ­patch/apply makes backup copies of the current source tree’s files.  The backups are stored in the patch directory. 

­Patch/undo will copy the backups saved by ­patch/apply back into the source tree.  It will not restore a backup if the file being replaced is not byte-identical to the one created by ­patch/apply. 

EXAMPLES

Propose a change to pwd, which you have modified locally:

% patch/create pwd-errors /sys/src/cmd/pwd.c
Fix pwd to print errors to fd 2 rather than 1.
^D
%

Then the developers at Bell Labs run

patch/diff pwd-errors

to inspect the change (possibly viewing ­/n/sources/patch/pwd-errors/pwd.c to see the larger context).  To make the change, they run

patch/apply pwd-errors

Otherwise they run

% patch/note pwd-errors
Pwd should definitely print errors to fd 1 because ...
^D
%

to add a note to the ­/n/sources/pwd-errors/notes file. 

FILES

­/n/sources/patch

SOURCE

­/rc/bin/patch

SEE ALSO

diff(1)

Plan 9  —  November 02, 2003

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026