I'd like to propose these as the semantics for the checkpointing of a workspace
On checkpoint, create a file called:
.git/checkpoint/<treeid>
where the contents of the file are:
exactly identical to the index file immediately prior to the
checkpoint being performedand the treeid is the tree that results from:
git-update-cache $(git-diff-files | cut -f2)
git-write-treeTo restore from the checkpoint, one does:
/* magic to remove files that are not in the resulting tree */
git-read-tree -m <treeid>
git-checkout-cache -u -f -a
cp .git/checkpoints/<treeid> .git/indexComments?