Re: Rebasing stgit stacks
- From
- Catalin Marinas <catalin.marinas@gmail.com>
- Date
- Jan 28, 2007, 23:21 UTC
- Message-ID
- <b0943d9e0701281521i60da11dfscd8649f56960730d@mail.gmail.com>
- In-Reply-To
- <20070128043312.GG9897@thunk.org>
On 28/01/07, Theodore Tso <tytso@mit.edu> wrote:
Show 13 quoted lines
> Well, a typical use case for me is: > > stg branch master > git pull . > stg branch 2.6.20-rc5 > stg export -d /tmp/temp-stack > stg branch master > stg branch -C 2.6.20-rc6 > stg import -s /tmp/temp-stack/series > > That's because I want to keep the original patch series for > 2.6.20-rc5, but I also want rebase the patch set to 2.6.20-rc6. Is > there a better way of doing this?
As Yann pointed out, you could just clone 2.6.20-rc5 into 2.6.20-rc6 and rebase the latter (currently with 'stg rebase v2.6.20-rc6').
If you have the branches already created, you can avoid the export/import with a cherry-pick (with better merging than just applying a patch). The 'pick' command only takes an argument (I'd like to extend it to accept multiple or patch ranges) but you can use it with 'series':
stg branch 2.6.20-rc6 stg series -b 2.6.20-rc5 --noprefix --showbranch [patches...] \ | xargs -rn1 stg pick
You could even use the --missing instead of -b for the series command. This option shows the patches on the remote branch which are missing in current. Pretty useful if you want to continue importing after fixing a conflict for example (that's a reason why I haven't extended 'pick' yet, 'series -m' seemed pretty powerful).
Another trick if you modify some patches in one branch (i.e. 2.6.20-rc5) is to use 'stg sync -b 2.6.20-rc5 [patches]' in the other branch. It tries a three-way merge of each individual patch with the corresponding one in the other branch, showing you any possible conflicts (I usually have 'imerger' set to emacs... and 'autoimerge' to 'yes' in the config file so that emacs' ediff is automatically invoked for every conflict).
-- Catalin