git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] rebase --onto detection of already applied commits
@ 2022-12-12 11:35 Cristian Ciocaltea
  2022-12-12 11:35 ` [RFC PATCH 1/1] rebase --onto: Skip previously " Cristian Ciocaltea
  2022-12-13  0:13 ` [RFC PATCH 0/1] rebase --onto detection of already " Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Cristian Ciocaltea @ 2022-12-12 11:35 UTC (permalink / raw)
  To: git

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-12-15 17:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 11:35 [RFC PATCH 0/1] rebase --onto detection of already applied commits Cristian Ciocaltea
2022-12-12 11:35 ` [RFC PATCH 1/1] rebase --onto: Skip previously " Cristian Ciocaltea
2022-12-12 12:27   ` Ævar Arnfjörð Bjarmason
2022-12-12 15:37     ` Cristian Ciocaltea
2022-12-13  0:13 ` [RFC PATCH 0/1] rebase --onto detection of already " Junio C Hamano
2022-12-13 10:37   ` Cristian Ciocaltea
2022-12-13 12:38     ` Junio C Hamano
2022-12-13 13:04     ` Phillip Wood
2022-12-13 15:34       ` Cristian Ciocaltea
2022-12-15 15:40         ` Phillip Wood
2022-12-15 16:02           ` Cristian Ciocaltea
2022-12-15 17:07             ` Phillip Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).