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

Re: stgit: lost all my patches again

From
Karl Hasselström <kha@treskal.com>
Date
Nov 28, 2007, 17:19 UTC
Message-ID
<20071128171917.GA21310@diana.vm.bytemark.co.uk>
In-Reply-To
<9e4733910711280858j5d03b3acleac0ece7b0a67f66@mail.gmail.com>
On 2007-11-28 11:58:14 -0500, Jon Smirl wrote:
> After someone runs the wrong command their first instinct will be to
> run stg repair. Can stg repair be made smart enough to not attempt a
> repair if it is unable to do so and print a message referring people
> back to the manual on how to move the head back?
Well, the thing is, it's never unable to repair.

However, I could add another repair mode: reset the branch head to the latest point in the reflog where it was consistent with StGit's metadata.

repair would have two flags to select the original or this new repair mode, and if the user doesn't give either flag, repair points out that she has two choices, and what they mean:

  "If you want to undo the last 3 git commands
     pull : Fast forward
     commit (amend): fix
     reset --hard kha/experimental: updating HEAD
   call stg repair --undo. If you want StGit to adjust to the new
   situation, call stg repair --assimilate."
> When I ran stg repair after the wrong git rebase command, I
> compounded the problem further.

Not that much. It was the push following the repair that killed you. The repair alone is totally benign; doing

  $ stg repair && git reset --hard foobar && stg repair
gives the same result as just
  $ git reset --hard foobar && stg repair
except for creating a few new patches that you can safely delete.
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Jon SmirlNext: Karl Hasselström
Message 22 of 26 in “stgit: lost all my patches again”
  1. Jon SmirlNov 27, 2007
  2. Jakub NarebskiNov 27, 2007
  3. Jon SmirlNov 27, 2007
  4. Karl HasselströmNov 28, 2007
  5. StGit hooksKarl Hasselström, Nov 28, 2007
  6. Andreas EricssonNov 28, 2007
  7. Karl HasselströmNov 28, 2007
  8. Andreas EricssonNov 28, 2007
  9. Karl HasselströmNov 28, 2007
  10. Andreas EricssonNov 28, 2007
  11. Jon SmirlNov 28, 2007
  12. Andreas EricssonNov 28, 2007
  13. Karl HasselströmNov 28, 2007
  14. Andreas EricssonNov 28, 2007
  15. Karl HasselströmNov 28, 2007
  16. Junio C HamanoNov 28, 2007
  17. Jon SmirlNov 28, 2007
  18. Karl HasselströmNov 28, 2007
  19. Jon SmirlNov 28, 2007
  20. Karl HasselströmNov 28, 2007
  21. Jon SmirlNov 28, 2007
  22. Karl HasselströmNov 28, 2007
  23. Make "stg repair" help text more helpfulKarl Hasselström, Nov 30, 2007
  24. Junio C HamanoNov 28, 2007
  25. Jon SmirlNov 28, 2007
  26. Karl HasselströmNov 28, 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.