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

Re: Rollback of git commands

From
Jon Smirl <jonsmirl@gmail.com>
Date
Nov 28, 2007, 17:03 UTC
Message-ID
<9e4733910711280903w26e9821ah17db9ad468dea460@mail.gmail.com>
In-Reply-To
<alpine.LFD.0.99999.0711281141150.9605@xanadu.home>
On 11/28/07, Nicolas Pitre <nico@cam.org> wrote:
Show 36 quoted lines
> On Wed, 28 Nov 2007, Jon Smirl wrote:
>
> > On 11/28/07, Nicolas Pitre <nico@cam.org> wrote:
> > > On Wed, 28 Nov 2007, Jon Smirl wrote:
> > >
> > > > On 11/28/07, Nicolas Pitre <nico@cam.org> wrote:
> > > > > On Tue, 27 Nov 2007, Jon Smirl wrote:
> > > > >
> > > > > > Of course you've never screwed up a repository using git commands,
> > > > > > right? I've messed up plenty. A good way to mess up a repo is to get
> > > > > > the data in .git/* out of sync with what is in the repo. I'm getting
> > > > > > good enough with git that I can fix most mess up with a few edits, but
> > > > > > it took me two years to get to that point. Rolling back to a check
> > > > > > point is way easier. User error and a command failing are both equally
> > > > > > valid ways to mess up a repo.
> > > > >
> > > > > The reflog contains all your check points, for every modifications you
> > > > > make, even the stupid ones.  You should look at it.
> > > >
> > > > The state contained in the other config files in .git/* is not getting
> > > > check pointed. I can use reflog to move my branch heads around. But
> > > > doing that does not undo the changes to the state recorded in .git/*.
> > > > After the error I encountered  I moved my branch head back, but the
> > > > state stgit had stored in .git/* was out of sync with where the branch
> > > > had been moved to.
> > >
> > > It's up to stgit to version control its state then.  It may even use a
> > > reflog for it.  All the machinery is there already.
> >
> > Git has state in .git/* too, shouldn't it be version controlling it
> > too? If git was version controlling the state in .git/* you'd have
> > checkpoints with the ability to roll back.
>
> Well, the .git directory contains data to identify what is actually
> version controlled.  If you start versioning the data used to implement
> the versioning, don't you get into endless recursion here?

You would end up with a single non-version controlled sha pointer that would need to be stored externally. That pointer would be the beginning of the rollback log. It's just a normal commit chain.

In a totally version controlled system. .git/* would only contain objects and the one pointer to the current state of the system.

-- 
Jon Smirl
jonsmirl@gmail.com
Previous: Nicolas PitreNext: Karl Hasselström
Message 22 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.