diff mbox series

[v3,14/30] subtree: drop support for git < 1.7

Message ID 20210427211748.2607474-15-lukeshu@lukeshu.com (mailing list archive)
State Accepted
Commit 8dc3240f5fc78aec1b1e6b10b94fa361bf016157
Headers show
Series subtree: clean up, improve UX | expand

Commit Message

Luke Shumaker April 27, 2021, 9:17 p.m. UTC
From: Luke Shumaker <lukeshu@datawire.io>

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>
 - Include rationale in the the commit message.

 contrib/subtree/git-subtree.sh | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
diff mbox series


diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 9ca498f81c..4503564f7e 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -852,23 +852,12 @@  cmd_merge () {
-	version=$(git version)
-	if test "$version" \< "git version 1.7"
+	if test -n "$message"
-		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"
-		if test -n "$message"
-		then
-			git merge -Xsubtree="$prefix" \
-				--message="$message" "$rev"
-		else
-			git merge -Xsubtree="$prefix" $rev
-		fi
+		git merge -Xsubtree="$prefix" $rev