Re: Semantics for one step undo/redo
Sorry, I omitted an important aspect of REDO Post-conditions - corrected below
Show 17 quoted lines
> REDO Semantics
> - redo will replay a previous commit but any or all of the tree,
> the parents, the message may be replaced by edited values.
>
> REDO Pre-conditions:
> - at least one entry exists in the .git/redo-log
> - the cache matches the working tree
> - .nextmsg contains the commit message
> - HEAD contains the commit id of the current predecessor (which
> may differ from the logged value)
>
> REDO Post-conditions:
> - the working tree is committed with .nextmsg as its message, the
> first parent replaced by HEAD and the remaining parents read from .the
> tail of .git/redo-log
> - .nextmsg is cleared
> - the last line of .git/redo-log is removed
additional post-conditions:
- the diff between the old head and its old parent (as read from
the log) is applied to the workspace and cache.
- if the re-applied diff fails, the workspace and cache are
returned back to the state immediately following the previous commit
and the user has the chance to manually reapply the diffs before
updating the index into a state that allows further redos
jon.