]> git.ipfire.org Git - thirdparty/git.git/commitdiff
subtree: drop support for git < 1.7
authorLuke Shumaker <lukeshu@datawire.io>
Tue, 27 Apr 2021 21:17:32 +0000 (15:17 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Apr 2021 07:47:17 +0000 (16:47 +0900)
Suport for Git versions older than 1.7.0 (older than February 2010) was
nice to have when git-subtree lived out-of-tree.  But now that it lives
in git.git, it's not necessary to keep around.  While it's technically
in contrib, with the standard 'git' packages for common systems
(including Arch Linux and macOS) including git-subtree, it seems
vanishingly likely to me that people are separately installing
git-subtree from git.git alongside an older 'git' install (although it
also seems vanishingly likely that people are still using >11 year old
git installs).

Not that there's much reason to remove it either, it's not much code,
and none of my changes depend on a newer git (to my knowledge, anyway;
I'm not actually testing against older git).  I just figure it's an easy
piece of fat to trim, in the journey to making the whole thing easier to
hack on.

"Ignore space change" is probably helpful when viewing this diff.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh

index 9ca498f81c9d81ea3d5931c2d41d5f4d7b720303..4503564f7ea3d60f2ede3e3792468be3e409c2e3 100755 (executable)
@@ -852,23 +852,12 @@ cmd_merge () {
                rev="$new"
        fi
 
-       version=$(git version)
-       if test "$version" \< "git version 1.7"
+       if test -n "$message"
        then
-               if test -n "$message"
-               then
-                       git merge -s subtree --message="$message" "$rev"
-               else
-                       git merge -s subtree "$rev"
-               fi
+               git merge -Xsubtree="$prefix" \
+                   --message="$message" "$rev"
        else
-               if test -n "$message"
-               then
-                       git merge -Xsubtree="$prefix" \
-                               --message="$message" "$rev"
-               else
-                       git merge -Xsubtree="$prefix" $rev
-               fi
+               git merge -Xsubtree="$prefix" $rev
        fi
 }