git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: stgit: lost all my patches again
Date: Wed, 28 Nov 2007 10:06:57 -0500	[thread overview]
Message-ID: <9e4733910711280706j45fe9c17t928396eb8e1de8bf@mail.gmail.com> (raw)
In-Reply-To: <20071128093403.GB12977@diana.vm.bytemark.co.uk>

On 11/28/07, Karl Hasselström <kha@treskal.com> wrote:
> 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

I did 'stg repair' after doing 'git rebase'. After the repair half of
my patches were marked as being applied and half not. The ones that
were applied were all empty. They were probably empty because my
original patches were still commited by stg in front of the rebase. I
couldn't figure out how to recover so I extracted the pre-rebase
commits manual, built a series file and started again on a new branch.

When I applied the patches to a clean branch none of them had conflicts.

> 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.

I did this:
all pataches were applied
git rebase
stg repair -- partial repair, some patches empty, half are pushed
moved HEAD back in front of rebase
stg repair - it show all my patches as popped, but when I started
doing command it complain that some commits that stg needed were not
there.

The complaint was caused by the first repair. The first repair altered
some of the stg state to point at commits past the rebase. That why I
wanted check point. At this point I could move the HEAD back without
also reverting the stgit state in .git/*


>
> > 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
>


-- 
Jon Smirl
jonsmirl@gmail.com

  parent reply	other threads:[~2007-11-28 15:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 22:17 stgit: lost all my patches again Jon Smirl
2007-11-27 22:24 ` Jakub Narebski
2007-11-27 23:12 ` Jon Smirl
2007-11-28  9:34   ` Karl Hasselström
2007-11-28 10:17     ` StGit hooks Karl Hasselström
2007-11-28 11:44       ` Andreas Ericsson
2007-11-28 12:19         ` Karl Hasselström
2007-11-28 13:14           ` Andreas Ericsson
2007-11-28 13:26             ` Karl Hasselström
2007-11-28 14:11               ` Andreas Ericsson
2007-11-28 14:53                 ` Jon Smirl
2007-11-28 14:58                   ` Andreas Ericsson
2007-11-28 15:40                     ` Karl Hasselström
2007-11-28 17:06                       ` Andreas Ericsson
2007-11-28 17:21                         ` Karl Hasselström
2007-11-28 19:31                           ` Junio C Hamano
2007-11-28 15:06     ` Jon Smirl [this message]
2007-11-28 16:04       ` stgit: lost all my patches again Karl Hasselström
2007-11-28 16:21         ` Jon Smirl
2007-11-28 16:41           ` Karl Hasselström
2007-11-28 16:58             ` Jon Smirl
2007-11-28 17:19               ` Karl Hasselström
2007-11-30  6:35             ` [StGit PATCH] Make "stg repair" help text more helpful Karl Hasselström
2007-11-28  0:37 ` stgit: lost all my patches again Junio C Hamano
2007-11-28  2:59   ` Jon Smirl
2007-11-28  6:32     ` Karl Hasselström
  -- strict thread matches above, loose matches on Subject: below --
2007-10-04  5:29 Jon Smirl
2007-10-04  8:33 ` Karl Hasselström
2007-10-04 12:10   ` Jon Smirl
2007-10-04 13:06   ` Jon Smirl
2007-10-04 15:38     ` Karl Hasselström
2007-10-04 15:45   ` David Brown
2007-10-04 17:29     ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e4733910711280706j45fe9c17t928396eb8e1de8bf@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).