On 2006-02-15 11:42:55 +0100, Andreas Ericsson wrote:
Karl Hasselström wrote:
quoted
You can actually do this today; just create a new branch where you
want your new stgit stack to be based, and "stg pick" the
commits/patches from the old branch:
$ git-checkout -b new-branch HEAD^^^
$ stg init
$ stg pick old-branch^^^ -n create-foo
$ stg pick old-branch^^ -n improve-foo
$ stg pick old-branch^ -n improve-bar
$ git-branch -D old-branch
$ git-checkout -b old-branch
$ git-branch -d new-branch
This series of commands also converts the top three commits to
stgit patches, and leaves the user on the same branch where she
started (it does _exactly_ the same job as "stg uncommit
improve-bar improve-foo create-foo"), but it's a lot of work, and
a typo could lose commits.
Isn't this akin to what "git cherry-pick" does, except for the
"convert to stgit patches" thing?
Yes, "stg pick" and git-cherry-pick are very similar as far as I know,
the only difference being that "stg pick" creates an stgit patch while
git-cherry-pick creates a regular commit. (And an applied stgit patch
is just a regular commit which stgit maintains some metadata about.)
However, using git-cherry-pick in this scenario would just recreate
the initial state exactly, since converting the commits to stgit
patches was what it was all about.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle