All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Zhang <zhgdrx@gmail.com>
To: git@vger.kernel.org
Subject: why "git rebase" searching the duplicate patches in <upstream branch> rather than in <new base branch>?
Date: Tue, 20 Jul 2021 01:45:01 +0800	[thread overview]
Message-ID: <CAJcwCMPHFNHi5i=xRg=GAJL5HiUfKu_KUPwYwELofLLtOAK1bg@mail.gmail.com> (raw)
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

//----

       reply	other threads:[~2021-07-19 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJcwCMPU9EhRkqeei_LnYyTJRZUQgHCvomrBbW0Qn+Jp1yhQfQ@mail.gmail.com>
2021-07-19 17:45 ` Andy Zhang [this message]
2021-07-19 18:17   ` why "git rebase" searching the duplicate patches in <upstream branch> rather than in <new base branch>? Felipe Contreras
2021-07-19 22:23   ` Junio C Hamano
2021-07-20  9:04     ` Sergey Organov
2021-07-20 15:36       ` Junio C Hamano
2021-07-20 16:44         ` Sergey Organov
2021-08-01  8:59     ` Andy Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJcwCMPHFNHi5i=xRg=GAJL5HiUfKu_KUPwYwELofLLtOAK1bg@mail.gmail.com' \
    --to=zhgdrx@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.