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
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 19, 2021, 18:17 UTC
Message-ID
<60f5c1a5c8422_13f62b208e@natae.notmuch>
In-Reply-To
<CAJcwCMPHFNHi5i=xRg=GAJL5HiUfKu_KUPwYwELofLLtOAK1bg@mail.gmail.com>
Andy Zhang wrote:
Show 20 quoted lines
> why "git rebase" searching the duplicate patches in <upstream branch>
> rather than in <new base branch>?
> 
> hi, all:
> 
>  I am reading the help of "git rebase", it says:
>     "If the upstream branch already contains a change you have made
> (e.g., because you mailed a patch which was applied upstream), then
> that commit will be skipped. "
> 
>  But, because we are applying commits to <new base branch> rather than
> to <upstream branch>, I really don't understand why we are searching
> the duplicate patches in <upstream branch> rather than in <new base
> branch>?
> 
>  In the following example, the git command is as:
>    git rebase --onto master next topic
> 
>  I think it should be reasonable to search the duplicate patches in
> <new base branch>(i.e, master) instead of <next branch>.
My understanding is that only applies when --onto is not specified:
  git rebase master topic

In this case "master" is both the new base, and upstream, and it's in this case where duplicates are skipped.

If you specify --onto master, then this isn't done.
-- 
Felipe Contreras
Previous: Andy ZhangNext: Junio C Hamano
Message 2 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.