]> git.ipfire.org Git - thirdparty/git.git/commit - contrib/subtree/git-subtree.sh
subtree: allow --squash to be used with --rejoin
authorLuke Shumaker <lukeshu@datawire.io>
Tue, 27 Apr 2021 21:17:45 +0000 (15:17 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Apr 2021 07:47:19 +0000 (16:47 +0900)
commitcb6551447b8e0c35408b766ad605ba357f720a0d
tree97a2b36766fb94568733ab4be4e35982b06df9d4
parent6468784dd2ca3ea2408f9915ab9b7ce136f0b024
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>
contrib/subtree/git-subtree.sh
contrib/subtree/git-subtree.txt
contrib/subtree/t/t7900-subtree.sh