Re: On git 1.6 (novice's opinion)
- From
- Etienne Vallette d'Osia <etienne.vallettedosia@gmail.com>
- Date
- Mar 27, 2009, 10:57 UTC
- Message-ID
- <49CCB129.1070606@gmail.com>
- In-Reply-To
- <49CCAF5D.21814.24B4DE63@Ulrich.Windl.rkdvmks1.ngate.uni-regensburg.de>
Ulrich Windl a écrit :
Show 6 quoted lines
>>> 3) "git undo": If possible undo the effects of the last command. > > If impossible, add confirmations for some "dangerous" (non-obvious) commands > before doing possibly harmful things. Maybe adding a kind of "user-level setting" > (novice, expert, guro) could control such confirmations. >
Why ? All objects stored are immutable, and some tools keep informations (ORIGIN_HEAD, refs/original) to allow a undo hand-made. Moreover the reflog (and stash if you want to use it for this use) store informations during time...
So it's possible to provide a generic undo for all commands that change refs.
Maybe an "undo" directory in $GIT_DIR, which will a keep a copy version of all refs. Every commands store the current refs in this folder _before_ to change anything, and the undo restore them all. At least, a "lastcmd" (for example) file could be added in this directory to allow an more clever undo.