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

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
Previous: Ævar Arnfjörð BjarmasonNext: Armin Ronacher
Message 4 of 11 in “Experience with Recovering From User Error (And suggestions for improvements)”
  1. Armin RonacherFeb 16, 2015
  2. Ævar Arnfjörð BjarmasonFeb 16, 2015
  3. Ævar Arnfjörð BjarmasonFeb 16, 2015
  4. Duy NguyenFeb 16, 2015
  5. Armin RonacherFeb 16, 2015
  6. Michael J GruberFeb 18, 2015
  7. Michael J GruberFeb 19, 2015
  8. stash: introduce checkpoint modeMichael J Gruber, Feb 19, 2015
  9. Kyle J. McKayFeb 19, 2015
  10. Junio C HamanoFeb 19, 2015
  11. Kyle J. McKayFeb 19, 2015

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.