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

Re: git-rebase skips automatically no more needed commits

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Sep 25, 2011, 03:25 UTC
Message-ID
<alpine.DEB.2.00.1109242148570.24369@debian>
In-Reply-To
<CALkWK0mggSNoxxqzUaGp1-AxGWSpCb0HnRmBxSkcVrHnhwMr1Q@mail.gmail.com>
Hi Ram and Thomas,
On Sat, 24 Sep 2011, Ramkumar Ramachandra wrote:
> Martin von Zweigbergk writes:
> > [...] We also want it to
> > work with --root, so we can not use git-cherry.

I think I was confused here; git-cherry should work just fine. Simply leaving out the limit, or setting it to $onto, makes the walk go all the way to the roots. After thinking a bit more about this, I'm instead wondering what the purpose of the --root flag to git-rebase is. Thomas introduced it in 190f532 (rebase: learn to rebase root commit, 2009-01-05).

If I understand correctly, it was introduced to solve exactly the same reason problem that made Francis start this thread -- to avoid re-applying patches that are already in $onto. In Thomas's patch, git-rebase started passing $onto..$orig_head instead of $upstream..$orig_head to git-format-patch. It also started passing --root to git-format-patch, but that was made unneccessary a few days later in 68c2ec7 (format-patch: show patch text for the root commit, 2009-01-10).

After my patches (that are not yet ready) that calculate revisions as "git cherry $onto $orig_head $upstream", I don't think there should be any need for the --root flag. The only place the flag is checked now (in my current work tree, that is) is when deciding how to interpret the remaining arguments. Although I have not tried (temporarily) rewriting all the test cases from

  git rebase --root --onto upstream branch
to
  git rebase upstream branch

, I think it should work. What do you think, Thomas? I saw that "--root" is also passed to the hook. Should that value be passed to the hook also when the old base is not explicitly a root (by "rebase --root"), but only implicitly so (by an $onto that is disjoint from $branch)?

Martin
Previous: Ramkumar RamachandraNext: Thomas Rast
Message 17 of 19 in “git-rebase skips automatically no more needed commits”
  1. Francis MoreauSep 6, 2011
  2. Junio C HamanoSep 6, 2011
  3. Francis MoreauSep 6, 2011
  4. Michael J GruberSep 7, 2011
  5. Junio C HamanoSep 7, 2011
  6. Francis MoreauSep 8, 2011
  7. Martin von ZweigbergkSep 8, 2011
  8. Martin von ZweigbergkSep 9, 2011
  9. Francis MoreauSep 9, 2011
  10. Martin von ZweigbergkSep 9, 2011
  11. Francis MoreauSep 9, 2011
  12. Martin von ZweigbergkSep 15, 2011
  13. Junio C HamanoSep 15, 2011
  14. Martin von ZweigbergkSep 16, 2011
  15. Martin von ZweigbergkSep 20, 2011
  16. Ramkumar RamachandraSep 24, 2011
  17. Martin von ZweigbergkSep 25, 2011
  18. Thomas RastSep 26, 2011
  19. Martin von ZweigbergkSep 28, 2011

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.