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

Would be nice to have a "git-checkpoint" command

From
GBGeert Bosch <bosch@adacore.com>
Date
Oct 24, 2006, 20:36 UTC
Message-ID
<8F8E6877-19F5-47F1-B7B6-E369BD39FC3E@adacore.com>
(Just an idea, no code yet.)

NAME ---- git-checkpoint - Save current state of the repository

SYNOPSIS -------- 'git-checkpoint' [--stdout] [-n]

DESCRIPTION ----------- This command generates trees/blobs for all files in the current git repository, including untracked files and directories and the .git directory itself, only excluding .git/objects.

With no options given, tree id is saved in .git/UNDO
OPTIONS
-------
--stdout::
	Write tree id of repository state to standard output, and
         do not write in .git/UNDO
-n|--no-create::
	Don't actually create new objects. Implies --stdout
(Discussion)

This could be used for implementing git-undo and git-redo commands. Note that an implicit chain of undo commands is kept, by restoring successive .git/UNDO files. Of course git-undo should save a .git/REDO file. Ideally both operations would keep a nice undo/redo stack.

The reason for not using commits is that this not meant for keeping history, just reverting mistakes. In particular, a prune will blow away all older UNDOs keeping just the last, which is fine. Doing a checkpoint should always succeed and never require user interaction.

Message 1 of 1 in “Would be nice to have a "git-checkpoint" command”
  1. Geert BoschOct 24, 2006

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.