git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "D. Ben Knoble" <ben.knoble@gmail.com>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Patrick Steinhardt <ps@pks.im>,
	Karthik Nayak <karthik.188@gmail.com>,
	Julia Evans <julia@jvns.ca>
Subject: [PATCH v9 0/5] doc: git-rebase: clarify DESCRIPTION section
Date: Sat, 23 Aug 2025 00:42:57 +0000	[thread overview]
Message-ID: <pull.1949.v9.git.1755909782.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1949.v8.git.1755276750.gitgitgadget@gmail.com>

Move the "TRANSPLANTING A TOPIC BRANCH WITH --ONTO" back up: now it's in the
exact same place it was before, just now with a section heading.

Julia Evans (5):
  doc: git-rebase: start with an example
  doc: git rebase: dedup merge conflict discussion
  doc: git rebase: clarify arguments syntax
  doc: git-rebase: move --onto explanation down
  doc: git-rebase: update discussion of internals

 Documentation/git-rebase.adoc | 149 +++++++++++++---------------------
 1 file changed, 58 insertions(+), 91 deletions(-)


base-commit: 64cbe5e2e8a7b0f92c780b210e602496bd5cad0f
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1949%2Fjvns%2Fclarify-rebase-v9
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1949/jvns/clarify-rebase-v9
Pull-Request: https://github.com/gitgitgadget/git/pull/1949

Range-diff vs v8:

 1:  e7a8fbbe53c = 1:  ea1438e094e doc: git-rebase: start with an example
 2:  ad63f69918d = 2:  339b7a1bc5b doc: git rebase: dedup merge conflict discussion
 3:  7ee6b0afe88 = 3:  f42c2c794a9 doc: git rebase: clarify arguments syntax
 4:  4686417b28e ! 4:  9c2a54ab9fa doc: git-rebase: move --onto explanation down
     @@ Documentation/git-rebase.adoc: will result in:
           D---E---A'---F master
       ------------
       
     --Here is how you would transplant a topic branch based on one
     --branch to another, to pretend that you forked the topic branch
     --from the latter branch, using `rebase --onto`.
     --
     --First let's assume your 'topic' is based on branch 'next'.
     --For example, a feature developed in 'topic' depends on some
     --functionality which is found in 'next'.
     --
     --------------
     --    o---o---o---o---o  master
     --         \
     --          o---o---o---o---o  next
     --                           \
     --                            o---o---o  topic
     --------------
     --
     --We want to make 'topic' forked from branch 'master'; for example,
     --because the functionality on which 'topic' depends was merged into the
     --more stable 'master' branch. 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
     --
     --
     --Another example of --onto option is to rebase part of a
     --branch.  If we have the following situation:
     --
     --------------
     --                            H---I---J topicB
     --                           /
     --                  E---F---G  topicA
     --                 /
     --    A---B---C---D  master
     --------------
     --
     --then the command
     --
     --    git rebase --onto master topicA topicB
     --
     --would result in:
     --
     --------------
     --                 H'--I'--J'  topicB
     --                /
     --                | E---F---G  topicA
     --                |/
     --    A---B---C---D  master
     --------------
     --
     --This is useful when topicB does not depend on topicA.
     --
     --A range of commits could also be removed with rebase.  If we have
     --the following situation:
     --
     --------------
     --    E---F---G---H---I---J  topicA
     --------------
     --
     --then the command
     --
     --    git rebase --onto topicA~5 topicA~3 topicA
     --
     --would result in the removal of commits F and G:
     --
     --------------
     --    E---H'---I'---J'  topicA
     --------------
     --
     --This is useful if F and G were flawed in some way, or should not be
     --part of topicA.  Note that the argument to `--onto` and the `<upstream>`
     --parameter can be any valid commit-ish.
     --
     - MODE OPTIONS
     - ------------
     - 
     ++TRANSPLANTING A TOPIC BRANCH WITH --ONTO
     ++----------------------------------------
     ++
     + Here is how you would transplant a topic branch based on one
     + branch to another, to pretend that you forked the topic branch
     + from the latter branch, using `rebase --onto`.
      @@ Documentation/git-rebase.adoc: As a special case, you may use "A\...B" as a shortcut for the
       merge base of A and B if there is exactly one merge base. You can
       leave out at most one of A and B, in which case it defaults to HEAD.
       
     -+See TRANSPLANTING A TOPIC BRANCH WITH --ONTO below for examples.
     ++See TRANSPLANTING A TOPIC BRANCH WITH --ONTO above for examples.
      +
       --keep-base::
       	Set the starting point at which to create the new commits to the
       	merge base of `<upstream>` and `<branch>`. Running
     -@@ Documentation/git-rebase.adoc: consistent (they compile, pass the testsuite, etc.) you should use
     - after each commit, test, and amend the commit if fixes are necessary.
     - 
     - 
     -+TRANSPLANTING A TOPIC BRANCH WITH --ONTO
     -+----------------------------------------
     -+
     -+Here is how you would transplant a topic branch based on one
     -+branch to another, to pretend that you forked the topic branch
     -+from the latter branch, using `rebase --onto`.
     -+
     -+First let's assume your 'topic' is based on branch 'next'.
     -+For example, a feature developed in 'topic' depends on some
     -+functionality which is found in 'next'.
     -+
     -+------------
     -+    o---o---o---o---o  master
     -+         \
     -+          o---o---o---o---o  next
     -+                           \
     -+                            o---o---o  topic
     -+------------
     -+
     -+We want to make 'topic' forked from branch 'master'; for example,
     -+because the functionality on which 'topic' depends was merged into the
     -+more stable 'master' branch. 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
     -+
     -+
     -+Another example of --onto option is to rebase part of a
     -+branch.  If we have the following situation:
     -+
     -+------------
     -+                            H---I---J topicB
     -+                           /
     -+                  E---F---G  topicA
     -+                 /
     -+    A---B---C---D  master
     -+------------
     -+
     -+then the command
     -+
     -+    git rebase --onto master topicA topicB
     -+
     -+would result in:
     -+
     -+------------
     -+                 H'--I'--J'  topicB
     -+                /
     -+                | E---F---G  topicA
     -+                |/
     -+    A---B---C---D  master
     -+------------
     -+
     -+This is useful when topicB does not depend on topicA.
     -+
     -+A range of commits could also be removed with rebase.  If we have
     -+the following situation:
     -+
     -+------------
     -+    E---F---G---H---I---J  topicA
     -+------------
     -+
     -+then the command
     -+
     -+    git rebase --onto topicA~5 topicA~3 topicA
     -+
     -+would result in the removal of commits F and G:
     -+
     -+------------
     -+    E---H'---I'---J'  topicA
     -+------------
     -+
     -+This is useful if F and G were flawed in some way, or should not be
     -+part of topicA.  Note that the argument to `--onto` and the `<upstream>`
     -+parameter can be any valid commit-ish.
     -+
     -+
     - RECOVERING FROM UPSTREAM REBASE
     - -------------------------------
     - 
 5:  cb85642bb9d ! 5:  5a1dd8df29b doc: git-rebase: update discussion of internals
     @@ Documentation/git-rebase.adoc: linkgit:git-config[1] for details) and the `--for
      +tip, however, is accessible using the reflog of the current branch (i.e. `@{1}`,
      +see linkgit:gitrevisions[7].
       
     - MODE OPTIONS
     - ------------
     + TRANSPLANTING A TOPIC BRANCH WITH --ONTO
     + ----------------------------------------

-- 
gitgitgadget

  parent reply	other threads:[~2025-08-23  0:43 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08 15:24 [PATCH 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-08 15:24 ` [PATCH 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-08 16:30   ` Junio C Hamano
2025-08-08 17:13     ` Julia Evans
2025-08-08 18:11       ` Junio C Hamano
2025-08-08 15:24 ` [PATCH 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-08 17:48   ` Junio C Hamano
2025-08-08 15:24 ` [PATCH 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-08 15:24 ` [PATCH 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-08 15:24 ` [PATCH 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-08 19:15 ` [PATCH v2 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-08 19:15   ` [PATCH v2 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-08 23:31     ` Junio C Hamano
2025-08-08 19:15   ` [PATCH v2 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-08 19:15   ` [PATCH v2 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-08 21:09     ` Junio C Hamano
2025-08-08 19:15   ` [PATCH v2 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-08 19:15   ` [PATCH v2 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-08 21:54     ` Junio C Hamano
2025-08-08 22:52   ` [PATCH v3 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-08 22:52     ` [PATCH v3 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-08 22:52     ` [PATCH v3 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-08 22:52     ` [PATCH v3 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-08 22:52     ` [PATCH v3 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-08 22:52     ` [PATCH v3 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-09  1:14     ` [PATCH v4 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-09  1:14       ` [PATCH v4 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-10 15:41         ` Phillip Wood
2025-08-11  8:46         ` Patrick Steinhardt
2025-08-11  9:13         ` Karthik Nayak
2025-08-11 12:27           ` Ben Knoble
2025-08-12  9:05             ` Karthik Nayak
2025-08-12 14:30               ` Junio C Hamano
2025-08-11 13:07           ` Phillip Wood
2025-08-12  9:07             ` Karthik Nayak
2025-08-12 17:07               ` D. Ben Knoble
2025-08-12 18:07                 ` Junio C Hamano
2025-08-14  7:23                   ` Karthik Nayak
2025-08-09  1:14       ` [PATCH v4 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-11  8:46         ` Patrick Steinhardt
2025-08-11 13:02           ` Phillip Wood
2025-08-09  1:14       ` [PATCH v4 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-09  1:14       ` [PATCH v4 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-09 14:55         ` D. Ben Knoble
2025-08-09  1:14       ` [PATCH v4 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-10 15:42         ` Phillip Wood
2025-08-13 18:55           ` symmetric difference with --left-only vs. range notation D. Ben Knoble
2025-08-13 21:40             ` Junio C Hamano
2025-08-11  8:46         ` [PATCH v4 5/5] doc: git-rebase: update discussion of internals Patrick Steinhardt
2025-08-11 12:29           ` Ben Knoble
2025-08-11 13:45             ` Patrick Steinhardt
2025-08-11 19:34           ` Julia Evans
2025-08-11 20:12       ` [PATCH v5 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-11 20:12         ` [PATCH v5 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-11 20:50           ` Junio C Hamano
2025-08-11 20:12         ` [PATCH v5 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-11 20:12         ` [PATCH v5 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-11 20:12         ` [PATCH v5 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-11 20:12         ` [PATCH v5 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-11 21:14           ` Junio C Hamano
2025-08-11 21:51         ` [PATCH v6 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-11 21:51           ` [PATCH v6 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-11 21:51           ` [PATCH v6 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-11 21:51           ` [PATCH v6 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-11 21:51           ` [PATCH v6 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-11 21:51           ` [PATCH v6 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-11 22:10             ` Junio C Hamano
2025-08-11 22:42               ` Julia Evans
2025-08-11 21:59           ` [PATCH v6 0/5] doc: git-rebase: clarify DESCRIPTION section Junio C Hamano
2025-08-12 13:49           ` [PATCH v7 " Julia Evans via GitGitGadget
2025-08-12 13:49             ` [PATCH v7 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-12 13:49             ` [PATCH v7 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-12 13:49             ` [PATCH v7 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-12 13:49             ` [PATCH v7 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-12 13:49             ` [PATCH v7 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-14 21:28               ` Junio C Hamano
2025-08-15 16:52             ` [PATCH v8 0/5] doc: git-rebase: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-08-15 16:52               ` [PATCH v8 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-15 16:52               ` [PATCH v8 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-15 16:52               ` [PATCH v8 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-15 16:52               ` [PATCH v8 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-15 21:05                 ` Junio C Hamano
2025-08-18 13:42                   ` Phillip Wood
2025-08-18 17:06                     ` Junio C Hamano
2025-08-19 15:03                       ` Julia Evans
2025-08-19 19:45                         ` Junio C Hamano
2025-08-15 16:52               ` [PATCH v8 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-18 13:43               ` [PATCH v8 0/5] doc: git-rebase: clarify DESCRIPTION section Phillip Wood
2025-08-23  0:42               ` Julia Evans via GitGitGadget [this message]
2025-08-23  0:42                 ` [PATCH v9 1/5] doc: git-rebase: start with an example Julia Evans via GitGitGadget
2025-08-23  0:42                 ` [PATCH v9 2/5] doc: git rebase: dedup merge conflict discussion Julia Evans via GitGitGadget
2025-08-23  0:43                 ` [PATCH v9 3/5] doc: git rebase: clarify arguments syntax Julia Evans via GitGitGadget
2025-08-23  0:43                 ` [PATCH v9 4/5] doc: git-rebase: move --onto explanation down Julia Evans via GitGitGadget
2025-08-23  0:43                 ` [PATCH v9 5/5] doc: git-rebase: update discussion of internals Julia Evans via GitGitGadget
2025-08-13 13:31           ` [PATCH v6 0/5] doc: git-rebase: clarify DESCRIPTION section Phillip Wood
2025-08-13 15:33             ` Julia Evans
2025-08-14 21:18               ` Junio C Hamano
2025-08-15 10:25                 ` Phillip Wood
2025-08-15 15:45                   ` Junio C Hamano
2025-08-15 15:54                     ` Phillip Wood
2025-08-15 15:56                       ` Julia Evans
2025-08-15 10:25               ` Phillip Wood
2025-08-09 15:04   ` [PATCH v2 " D. Ben Knoble

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=pull.1949.v9.git.1755909782.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=julia@jvns.ca \
    --cc=karthik.188@gmail.com \
    --cc=phillip.wood123@gmail.com \
    --cc=ps@pks.im \
    /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 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).