git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Semantics of a workspace checkpoint

From
Jon Seymour <jon.seymour@gmail.com>
Date
Jun 16, 2005, 08:21 UTC
Message-ID
<2cfc4032050616012146948b49@mail.gmail.com>
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/
Next: Petr Baudis
Message 1 of 3 in “Semantics of a workspace checkpoint”
  1. Jon SeymourJun 16, 2005
  2. Petr BaudisJun 16, 2005
  3. Jon SeymourJun 16, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.