Patchwork allows to maintain features as patches. This is useful for code handouts that build on each other, but cannot otherwise be maintained as branches. This is not recommended for projects where branches will do.
Early versions of patchwork appeared in OSM 2015/2016 at DIKU.
The purpose there was to manage the various versions of KUDOS, handed out throughout the course. Each handout contained additions/variations on the public code base, which were relevant to some given assignment. These changes could not be maintained as branches on KUDOS, as they might have revealed partial solutions to other and future assignments.
They could've been maintained in a private GitHub fork, but GitHub has poor support for this — "patchwork" would be needed elsewhere.
To make patchwork, you will need a patchfile. A patchfile is a shell script
which will be
sourced
by gen-patchwork.sh
and
gen-patch.sh
, but is primarily intended for the
definition of 4 variables: HTTPS_REMOTE
, BASETAG
, BASEPATCHES
, and
PATCHNAME
.
A "patchwork" is a clone of the HTTPS_REMOTE
, at tag BASETAG
, with the
patches listed in BASEPATCHES
applied on top, in addition to the working
patch PATCHNAME
(if any). That is, for each patch, there is a directory
containing a patchfile. These directories can be composed to form a patchwork
via the BASEPATCHES
array variable.
To get patchwork to work, you will also need to add the path to
tmpdir
to your PATH environment variable.
(In particular, gen-patch.sh
will need it.)
For readability, we recommend starting the file with editor control lines indicating that the patchfile is a conf-style file:
# -*- mode: conf-mode
# vim: set ft=config