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

[PATCH RFC 0/4] rebase -i: Add --refs option to rewrite heads within branch

From
Greg Price <price@ksplice.com>
Date
Dec 22, 2009, 22:20 UTC
Message-ID
<20091222222032.GU30538@dr-wily.mit.edu>

This RFC series adds a "ref" command to rebase -i, and an option --refs to generate "ref" commands in the original TODO file. This makes it easy to rebase a branch together with intermediate markers, or a series of branches.

For example, in this situation:
      part1 part2 topic
        |     |     |
        v     v     v
  A--*--*--*--*--*--*
   \
    B <--master

we may want to rebase 'topic' onto the new master, rewriting the intermediate branches 'part1', 'part2' to the corresponding new commits. This can be done with a sequence of "git rebase --onto" commands, but it's tricky to get right.

With this series, the command
  $ git rebase -i --refs master topic
suffices to produce this result:
        part1 part2 topic
  A       |     |     |
   \      v     v     v
    B--*--*--*--*--*--*
    ^
    |
    master
These patches work for me.  Before I recommend the last two patches
for merge, they'll need the following additional work:
 - interoperate with rebase --abort
 - add documentation
 - probably add tests
The series begins with two patches that are independently useful, and
that I believe are ready for merge:
  pretty: Add %D for script-friendly decoration
  log --decorate=full: drop the "tag: " prefix
They make the functionality of 'git log --decorate' available in an
output format optimized for machine parsing.  I expect other people
will find this useful for other scripts.
Greg
Next: Greg Price
Message 1 of 11 in “rebase -i: Add --refs option to rewrite heads within branch”
  1. 0/4 rebase -i: Add --refs option to rewrite heads within branchGreg Price, Dec 22, 2009
  2. 1/4 pretty: Add %D for script-friendly decorationGreg Price, Dec 22, 2009
  3. 2/4 log --decorate=full: drop the "tag: " prefixGreg Price, Dec 22, 2009
  4. 3/4 rebase -i: Add the "ref" commandGreg Price, Dec 22, 2009
  5. 4/4 rebase -i: add --refs option to rewrite heads within branchGreg Price, Dec 22, 2009
  6. Junio C HamanoDec 22, 2009
  7. Greg PriceDec 23, 2009
  8. Michael J GruberDec 23, 2009
  9. Greg PriceDec 23, 2009
  10. Junio C HamanoDec 23, 2009
  11. Johannes SchindelinDec 23, 2009

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.