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

[RFC PATCH 0/1] rebase --onto detection of already applied commits

From
CCCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Date
Dec 12, 2022, 11:35 UTC
Message-ID
<20221212113516.27816-1-cristian.ciocaltea@collabora.com>
Let's consider the following operation:
  git rebase --onto new-base upstream feature

where 'feature' contains a few commits on top of 'upstream' which need to be rebased onto 'new-base'.

The problem is that some of those commits have been already applied to 'new-base' and we would like to skip them as in a regular rebase command that doesn't use '--onto', i.e. expecting to see messages like:

  warning: skipped previously applied commit [...]
However, that doesn't happen and we either get
  dropping [...] -- patch contents already upstream

or a conflict if one of the rebased commits doesn't resolve to an empty patch anymore, e.g. due to additional changes applied on the target branch.

This seems to be similar to the behavior of '--reapply-cherry-picks' and cannot be disabled via '--no-reapply-cherry-picks' or by any other means.

The proposed patch is just a quick workaround, as I'm not sure what would be the proper or recommended approach to handle the scenario described. Any advice would be highly appreciated!

Cristian Ciocaltea (1):
  rebase --onto: Skip previously applied commits
 builtin/rebase.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
-- 
2.38.1
Next: Cristian Ciocaltea
Message 1 of 12 in “rebase --onto detection of already applied commits”
  1. 0/1 rebase --onto detection of already applied commitsCristian Ciocaltea, Dec 12, 2022
  2. 1/1 rebase --onto: Skip previously applied commitsCristian Ciocaltea, Dec 12, 2022
  3. Ævar Arnfjörð BjarmasonDec 12, 2022
  4. Cristian CiocalteaDec 12, 2022
  5. Junio C HamanoDec 13, 2022
  6. Cristian CiocalteaDec 13, 2022
  7. Junio C HamanoDec 13, 2022
  8. Phillip WoodDec 13, 2022
  9. Cristian CiocalteaDec 13, 2022
  10. Phillip WoodDec 15, 2022
  11. Cristian CiocalteaDec 15, 2022
  12. Phillip WoodDec 15, 2022

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.