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

Re: Rebasing stgit stacks

From
CMCatalin 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
Previous: Yann DirsonNext: Yann Dirson
Message 35 of 36 in “Howto use StGit and git-svn at same time”
  1. Guilhem BonnefilleJan 9, 2007
  2. Guilhem BonnefilleJan 9, 2007
  3. Yann DirsonJan 9, 2007
  4. Guilhem BonnefilleJan 15, 2007
  5. Rebasing stgit stacksYann Dirson, Jan 15, 2007
  6. Catalin MarinasJan 15, 2007
  7. Yann DirsonJan 15, 2007
  8. Catalin MarinasJan 16, 2007
  9. Yann DirsonJan 16, 2007
  10. Jakub NarebskiJan 16, 2007
  11. Karl HasselströmJan 17, 2007
  12. David KågedalJan 17, 2007
  13. Yann DirsonJan 17, 2007
  14. Yann DirsonJan 17, 2007
  15. Catalin MarinasJan 18, 2007
  16. Yann DirsonJan 18, 2007
  17. Jakub NarebskiJan 19, 2007
  18. Yann DirsonJan 20, 2007
  19. Jakub NarebskiJan 20, 2007
  20. Yann DirsonJan 20, 2007
  21. Catalin MarinasJan 22, 2007
  22. Catalin MarinasJan 18, 2007
  23. Yann DirsonJan 18, 2007
  24. Jakub NarebskiJan 19, 2007
  25. Catalin MarinasJan 22, 2007
  26. Yann DirsonJan 22, 2007
  27. Catalin MarinasJan 22, 2007
  28. Yann DirsonJan 23, 2007
  29. Catalin MarinasJan 23, 2007
  30. Yann DirsonJan 24, 2007
  31. Catalin MarinasJan 24, 2007
  32. Yann DirsonJan 24, 2007
  33. Theodore TsoJan 28, 2007
  34. Yann DirsonJan 28, 2007
  35. Catalin MarinasJan 28, 2007
  36. Yann DirsonJan 17, 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.