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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(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.

  -Geert
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]