Stack metadata version 5
commit7641796356f0e22058659a7dc9a33acc201d06b5
authorPeter Grayson <pete@jpgrayson.net>
Fri, 27 Aug 2021 23:10:36 +0000 (27 19:10 -0400)
committerPeter Grayson <pete@jpgrayson.net>
Wed, 22 Sep 2021 03:37:37 +0000 (21 23:37 -0400)
tree3fcfe3a9d05b667ef8f15f16093a316c9f815a7e
parent21c09b7c677faa669a274fc1c6ebb5ba49699b1a
Stack metadata version 5

Stack metadata is now kept in refs/stacks/<branch> instead of
refs/heads/<branch>.stgit. The rationale:

- StGit's metadata branch is an implementation detail that leaks to
  users whenever git branches are inspected.
- `git log --branches` and other views of the commit DAG can become
  extremely cluttered when the stack metadata branch enters the picture.
  Avoiding refs/heads solves this problem.
- There is a nice symmetry between refs/patches/<branch> and
  refs/heads/<branch>.
- Distributed use (push, pull, clone) of stack metadata is not
  significantly different with the new ref.

And the stack metadata file format is now JSON instead of the former
custom format.

- Can use off-the-shelf JSON parser and serializer from Python standard
  library. Fast, easy, and less surface area for bugs.
- Stack metadata becomes more accessible to third-party tools, scripts,
  and programming languages.
- JSON format allows for additional metadata to be associated with
  each patch and/or the entire stack. This may be useful for advanced
  features such as patch guards.
- The stack.json file remains at least as human-readable as the old meta
  file. Line-oriented diffs also remain effective.

Resolves #65.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
completion/stgit.zsh
stgit/commands/branch.py
stgit/lib/log.py
stgit/lib/stack.py
stgit/lib/stackupgrade.py
t/t1000-branch-create.sh
t/t1001-branch-rename.sh
t/t1009-gpg.sh
t/t2110-pull-stack.sh
t/t3100-reset.sh
t/t3101-reset-hard.sh