summaryrefslogtreecommitdiff
path: root/contrib/subtree/git-subtree.txt
diff options
context:
space:
mode:
authorLibravatar Luke Shumaker <lukeshu@datawire.io>2021-04-27 15:17:45 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-04-28 16:47:19 +0900
commitcb6551447b8e0c35408b766ad605ba357f720a0d (patch)
tree97a2b36766fb94568733ab4be4e35982b06df9d4 /contrib/subtree/git-subtree.txt
parentsubtree: give the docs a once-over (diff)
downloadtgif-cb6551447b8e0c35408b766ad605ba357f720a0d.tar.xz
subtree: allow --squash to be used with --rejoin
Besides being a genuinely useful thing to do, this also just makes sense and harmonizes which flags may be used when. `git subtree split --rejoin` amounts to "automatically go ahead and do a `git subtree merge` after doing the main `git subtree split`", so it's weird and arbitrary that you can't pass `--squash` to `git subtree split --rejoin` like you can `git subtree merge`. It's weird that `git subtree split --rejoin` inherits `git subtree merge`'s `--message` but not `--squash`. Reconcile the situation by just having `split --rejoin` actually just call `merge` internally (or call `add` instead, as appropriate), so it can get access to the full `merge` behavior, including `--squash`. Signed-off-by: Luke Shumaker <lukeshu@datawire.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/subtree/git-subtree.txt')
-rw-r--r--contrib/subtree/git-subtree.txt27
1 files changed, 11 insertions, 16 deletions
diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index 78baac1e6b..d7e6e7867c 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -109,9 +109,6 @@ settings passed to 'split' (such as '--annotate') are the same.
Because of this, if you add new commits and then re-split, the new
commits will be attached as commits on top of the history you
generated last time, so 'git merge' and friends will work as expected.
-+
-Note that if you use '--squash' when you merge, you should usually not
-just '--rejoin' when you split.
pull <repository> <remote-ref>::
Exactly like 'merge', but parallels 'git pull' in that
@@ -124,8 +121,8 @@ push <repository> <remote-ref>::
<remote-ref>. This can be used to push your subtree to
different branches of the remote repository.
-OPTIONS
--------
+OPTIONS FOR ALL COMMANDS
+------------------------
-q::
--quiet::
Suppress unnecessary output messages on stderr.
@@ -140,15 +137,11 @@ OPTIONS
want to manipulate. This option is mandatory
for all commands.
--m <message>::
---message=<message>::
- This option is only valid for 'add', 'merge', 'pull', and 'split --rejoin'.
- Specify <message> as the commit message for the merge commit.
-
-OPTIONS FOR 'add' AND 'merge' (ALSO: 'pull')
---------------------------------------------
+OPTIONS FOR 'add' AND 'merge' (ALSO: 'pull' AND 'split --rejoin')
+-----------------------------------------------------------------
These options for 'add' and 'merge' may also be given to 'pull' (which
-wraps 'merge').
+wraps 'merge') and 'split --rejoin' (which wraps either 'add' or
+'merge' as appropriate).
--squash::
Instead of merging the entire history from the subtree project, produce
@@ -176,6 +169,9 @@ Whether or not you use '--squash', changes made in your local repository
remain intact and can be later split and send upstream to the
subproject.
+-m <message>::
+--message=<message>::
+ Specify <message> as the commit message for the merge commit.
OPTIONS FOR 'split'
-------------------
@@ -229,9 +225,8 @@ Unfortunately, using this option results in 'git log' showing an extra
copy of every new commit that was created (the original, and the
synthetic one).
+
-If you do all your merges with '--squash', don't use '--rejoin' when you
-split, because you don't want the subproject's history to be part of
-your project anyway.
+If you do all your merges with '--squash', make sure you also use
+'--squash' when you 'split --rejoin'.
EXAMPLE 1. 'add' command