Re: Experience with Recovering From User Error (And suggestions for improvements)
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 16, 2015, 12:37 UTC
- Message-ID
- <CACsJy8B3wT5r+bSNHjEtwMcx6aVBGS9Ff++w5JU0NFN=KX4V=A@mail.gmail.com>
- In-Reply-To
- <CACBZZX7Kjf2owiAyVzRVMs36Vj4-aYVgQ13amiJRHH91HW3RWA@mail.gmail.com>
On Mon, Feb 16, 2015 at 7:10 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 8 quoted lines
>> We should definitely make recovery like this harder, but is there a >> reason for why you don't use "git reset --keep" instead of --hard? >> It'll keep any local changes to your index/staging area, and reset the >> files that don't conflict, if there's any conflicts the operation will >> be aborted. > > "Recovery like this easier", i.e. make it easier to get back > previously staged commits / blobs.
I started with git-undo (or what's its name) a while back (*). The idea is for dangerous commands like this we could save some data back, which would be pruned after some time. Saving stuff in index is quite easy because they are already in object database. For this reset --hard, we may need to hash/store some more blobs. I think it's worth the safety. Not sure if anyone's interested in continuing that work.
(*) found it: http://thread.gmane.org/gmane.comp.version-control.git/231621/focus=231879
-- Duy