Re: stgit: lost all my patches again
- From
Karl Hasselström <kha@treskal.com>
- Date
- Nov 28, 2007, 09:34 UTC
- Message-ID
- <20071128093403.GB12977@diana.vm.bytemark.co.uk>
- In-Reply-To
- <9e4733910711271512g790364e0ka4839b2be9fd4935@mail.gmail.com>
On 2007-11-27 18:12:49 -0500, Jon Smirl wrote:
> As Jakub pointed out to me "git reset --hard $(cat > .git/patches/<branch>/orig-base)" would have recovered from the > rebase command. But I had already typed 'stg repair' which > compounded the mess.
Unless it has a bug, the only thing "stg repair" will do is
* create some new applied patches out of commits reachable from HEAD
* mark some applied patches as unapplied
* mark some unapplied patches as applied
in order to make sure that the applied patches are precisely those that are reachable from HEAD, and that the sequence of applied patches doesn't have "holes" in it (that is, commits that aren't patches).
In particular, it should not ever modify your existing patches, and it will never move the branch head. Just resetting the branch head to wherever you want it to be (and then running repair again) should fix literally all problems.
> This is way too easy to do. One simple mistype of 'git' for 'stg' > and you're in a mess.
You're right, this is not user friendly. A pre-rebase hook sounds like a reasonable idea.
It would also be convenient with a post-commit hook that turns new commits into patches automatically. And gives "git commit --amend" the semantics of "stg refresh".
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle