Stack metadata version 4
The old stack and patch state stored in .git/patches is removed and no
longer used. The stack and patch state stored in refs/heads/<branch>.stgit
is now used to construct Stack objects.
Although the format of the files in the .stgit branch has not changed, the
removal .git/patches warrants the new metadata version 4.
The stack metadata format version is no longer stored in the local git
config. Instead the "Version" line from <branch>.stgit:meta now represents
both the file format version (4) and the overall stack metadata format
version (also 4).
Another metadata change is that "patch log" refs are removed. I.e.
refs/patches/<branch>/<patch>.log refs no longer exist. These patch log
refs were redundant with the patch metadata found in
<branch>.stgit:patches/<patch>. Viewing per-patch logs can still be
accomplished with `stg log <patch>`.
Rudimentary support for pulling stack state from a remote (i.e. pulling
from a remote .stgit ref) is added. A couple changes of note to support
this:
- When a Stack is instantiated from the stack state metadata (from the
.stgit branch), there is code that ensures that all of the patch refs
(i.e. refs/patches/<branch>/*) exist and point to the correct commit.
Thus pulling *only* the <branch>.stgit ref from a remote is sufficient;
the patch refs do not need to be pulled separately.
- Eliminating the metadata format version from the config enables a branch
and its corresponding StGit metadata branch to be fully initialized
simply by pulling those branches from a remote since all of the relevant
metadata is now entirely contained within git objects in the repository.
- t2110-pull-stack.sh is added to test this rudimentary stack pulling
behavior.
Signed-off-by: Peter Grayson <pete@jpgrayson.net>