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

Re: Rollback of git commands

From
IMIngo Molnar <mingo@elte.hu>
Date
Nov 28, 2007, 16:50 UTC
Message-ID
<20071128165033.GA31218@elte.hu>
In-Reply-To
<ee77f5c20711271757h724d5fcep38f3c2354c54f20b@mail.gmail.com>
* David Symonds <dsymonds@gmail.com> wrote:
Show 13 quoted lines
> On Nov 28, 2007 12:49 PM, Jon Smirl <jonsmirl@gmail.com> wrote:
> > Rollback is too strong of name for this. Checkpoints would be better.
> > The idea is to record the total system state at convenient moments and
> > then allow moving back to the checkpointed state. The object store
> > supports this, but the rest of the state in .git/* isn't being
> > recorded.
> 
> rsync -a .git /somewhere/safe
> 
> I fear that what you ask becomes a chicken-and-egg scenario: where/how 
> is this checkpointing information going to be stored? If it's tightly 
> integrated with Git, what happens when you want to roll-back a 
> checkpoint-restore?

well, it would/could be the normal undo/redo semantics of editors: you can undo-redo in a linear history fashion, in an unlimited way, but the moment you modify any past point of history then the redo future is overriden. (but the 'past' up to that point is still recorded and available)

and this could all be driven via .git/logs - as long as all other metadata is imported into the object store and the root of this git tree would be represented in a single file. The logs are append-only as well, the loss of them means the loss of undo/redo information, nothing else. Figuring out the linear history from the logs would be computationally expensive, but that's not a big issue as 'undo/redo' would be a rare operation anyway.

But i guess i must be missing some obvious complication?
	Ingo
Previous: David SymondsNext: Sergei Organov
Message 6 of 31 in “Rollback of git commands”
  1. Jon SmirlNov 27, 2007
  2. Junio C HamanoNov 28, 2007
  3. Jon SmirlNov 28, 2007
  4. Jon SmirlNov 28, 2007
  5. David SymondsNov 28, 2007
  6. Ingo MolnarNov 28, 2007
  7. Sergei OrganovNov 28, 2007
  8. Nicolas PitreNov 28, 2007
  9. Geert BoschNov 28, 2007
  10. Jeff KingNov 28, 2007
  11. Jon SmirlNov 28, 2007
  12. Jeff KingNov 28, 2007
  13. SeanNov 28, 2007
  14. Jon SmirlNov 28, 2007
  15. SeanNov 28, 2007
  16. Jon SmirlNov 28, 2007
  17. Nicolas PitreNov 28, 2007
  18. Jon SmirlNov 28, 2007
  19. Nicolas PitreNov 28, 2007
  20. Jon SmirlNov 28, 2007
  21. Nicolas PitreNov 28, 2007
  22. Jon SmirlNov 28, 2007
  23. Karl HasselströmNov 29, 2007
  24. Junio C HamanoNov 28, 2007
  25. Karl HasselströmNov 28, 2007
  26. Jon SmirlNov 28, 2007
  27. Daniel BarkalowNov 28, 2007
  28. Steven GrimmNov 28, 2007
  29. Daniel BarkalowNov 28, 2007
  30. Jon SmirlNov 28, 2007
  31. Theodore TsoNov 29, 2007

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.