Subject: Semantics of a workspace checkpoint

From: Jon Seymour <[email-masked]>
Date: Thu, 16 Jun 2005 18:21:28 +1000

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 performed

and the treeid is the tree that results from:

    git-update-cache $(git-diff-files | cut -f2)
    git-write-tree

To 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/index

Comments?
-- 
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/