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

Re: why "git rebase" searching the duplicate patches in <upstream branch> rather than in <new base branch>?

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2021, 15:36 UTC
Message-ID
<xmqqczrdhu9q.fsf@gitster.g>
In-Reply-To
<87a6mhgxv4.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
> Similar problem should exist for explicitly specified <upstream> that
> might happen to have little in common with the current <branch>, right?

I do not think so. Plain-vanilla rebase is to carry forward our changes on top of updated upstream, which means that there is

            x--x--x (side)
           /
   ---o---o---o---o---o---o (upstream)
          ^
       (old upstream)

inherently ancestry relationship between the old upstream and the current upstream when rebasing 'side' to 'upstream'.

> I don't actually like this.

You do not have to ;-) because I was not suggesting to change any existing behaviour. It was merely me thinking aloud, how I might do the feature if I were designing it from scratch now.

Show 5 quoted lines
> Overall, it seems that we should take the <newbase> rather than
> <upstream> (that is still <upstream> when --onto is not specified), and
> apply the skipping logic from there, to whatever depth the merge-base
> will give us. If it's already implemented this way, then only the manual
> page needs to be fixed.
Sounds sensible.  I didn't check what the actual code does ;-)
Previous: Sergey OrganovNext: Sergey Organov
Message 5 of 7 in “why "git rebase" searching the duplicate patches in <upstream branch> rather than in <new base branch>?”
  1. Andy ZhangJul 19, 2021
  2. Felipe ContrerasJul 19, 2021
  3. Junio C HamanoJul 19, 2021
  4. Sergey OrganovJul 20, 2021
  5. Junio C HamanoJul 20, 2021
  6. Sergey OrganovJul 20, 2021
  7. Andy ZhangAug 1, 2021

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.