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

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

From
AZAndy Zhang <zhgdrx@gmail.com>
Date
Jul 19, 2021, 17:45 UTC
Message-ID
<CAJcwCMPHFNHi5i=xRg=GAJL5HiUfKu_KUPwYwELofLLtOAK1bg@mail.gmail.com>
In-Reply-To
<CAJcwCMPU9EhRkqeei_LnYyTJRZUQgHCvomrBbW0Qn+Jp1yhQfQ@mail.gmail.com>

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>.
 If possible, an improvement may be an option for enabling searching
in <new base branch> as well?
  Thank you in advance for any enlightenment you can provide!
Jintao Zhu

//---- example:

Old tree is:
o---o---o---o---o  master
    \
     o---o---o---o---o  next
                      \
                       o---o---o  topic
We want our tree to look like this:
o---o---o---o---o  master
   |            \
   |             o'--o'--o'  topic
    \
     o---o---o---o---o  next
We can get this using the following command:
  git rebase --onto master next topic
//----
Next: Felipe Contreras
Message 1 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.