git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/8] contrib/subtree: Remove --annotate

From
David A. Greene <greened@obbligato.org>
Date
Feb 18, 2013, 20:56 UTC
Message-ID
<1361221013-12756-8-git-send-email-greened@obbligato.org>
In-Reply-To
<1361221013-12756-1-git-send-email-greened@obbligato.org>
From: "David A. Greene" <greened@obbligato.org>

Remove --annotate. This obviates the need for an --unannotate command. We really want a more generalized commit message rewrite mechanism.

Signed-off-by: David A. Greene <greened@obbligato.org>
---
 contrib/subtree/git-subtree.sh     |    6 +----
 contrib/subtree/t/t7900-subtree.sh |   50 ++++++++++++++++++------------------
 2 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 1b3df99..2aceadc 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -21,7 +21,6 @@ d             show debug messages
 P,prefix=     the name of the subdir to split out
 m,message=    use the given message as the commit message for the merge commit
  options for 'split'
-annotate=     add a prefix to commit message of new commits
 b,branch=     create a new branch from the split subtree
 ignore-joins  ignore prior --rejoin commits
 onto=         try connecting new tree to an existing one
@@ -43,7 +42,6 @@ command=
 onto=
 rejoin=
 ignore_joins=
-annotate=
 squash=
 message=
 
@@ -79,8 +77,6 @@ while [ $# -gt 0 ]; do
 	case "$opt" in
 		-q) quiet=1 ;;
 		-d) debug=1 ;;
-		--annotate) annotate="$1"; shift ;;
-		--no-annotate) annotate= ;;
 		-b) branch="$1"; shift ;;
 		-P) prefix="${1%/}"; shift ;;
 		-m) message="$1"; shift ;;
@@ -311,7 +307,7 @@ copy_commit()
 			GIT_COMMITTER_NAME \
 			GIT_COMMITTER_EMAIL \
 			GIT_COMMITTER_DATE
-		(echo -n "$annotate"; cat ) |
+		(echo -n ""; cat ) |
 		git commit-tree "$2" $3  # reads the rest of stdin
 	) || die "Can't copy commit $1"
 }
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 5c6c73d..fa2a6c3 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -338,8 +338,8 @@ test_expect_success 'split subdir/ with --rejoin' '
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix=subdir --annotate="*") &&
-		git subtree split --prefix=subdir --annotate="*" --rejoin &&
+		split_hash=$(git subtree split --prefix=subdir) &&
+		git subtree split --prefix=subdir --rejoin &&
 		test_equal "$(last_commit_message)" "Split '\''subdir/'\'' into commit '\''$split_hash'\''"
 	)
  '
@@ -363,7 +363,7 @@ test_expect_success 'split subdir/ with --rejoin and --message' '
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --message="Split & rejoin" --annotate="*" --rejoin &&
+		git subtree split --prefix=subdir --message="Split & rejoin" --rejoin &&
 		test_equal "$(last_commit_message)" "Split & rejoin"
 	)
 '
@@ -387,8 +387,8 @@ test_expect_success 'split subdir/ with --branch' '
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix=subdir --annotate="*") &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br &&
+		split_hash=$(git subtree split --prefix=subdir) &&
+		git subtree split --prefix=subdir --branch subproj-br &&
 		test_equal "$(git rev-parse subproj-br)" "$split_hash"
 	)
  '
@@ -413,8 +413,8 @@ test_expect_success 'split subdir/ with --branch for an existing branch' '
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix=subdir --annotate="*") &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br &&
+		split_hash=$(git subtree split --prefix=subdir) &&
+		git subtree split --prefix=subdir --branch subproj-br &&
 		test_equal "$(git rev-parse subproj-br)" "$split_hash"
 	)
 '
@@ -466,7 +466,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -477,12 +477,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
@@ -517,7 +517,7 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -528,12 +528,12 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
@@ -568,7 +568,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -579,12 +579,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
@@ -623,7 +623,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -634,12 +634,12 @@ test_expect_success 'make sure each filename changed exactly once in the entire
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
@@ -682,7 +682,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -693,12 +693,12 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
@@ -731,7 +731,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
 		cd "$subtree_test_count" &&
 		git fetch ./subproj master &&
 		git subtree merge --prefix=subdir FETCH_HEAD &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/subproj" sub3 &&
 	test_create_commit "$subtree_test_count" subdir/main-sub3 &&
@@ -742,12 +742,12 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
 	test_create_commit "$subtree_test_count/subproj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" subdir/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix=subdir --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix=subdir --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/subproj" &&
-- 
1.7.10.4
Previous: David A. GreeneNext: David A. Greene
Message 11 of 12 in “Subtree Fixes Updates”
  1. David A. GreeneFeb 18, 2013
  2. 1/8 contrib/subtree: Use %B for split subject/bodyDavid A. Greene, Feb 18, 2013
  3. Junio C HamanoFeb 18, 2013
  4. 2/8 contrib/subtree: Fix whitespacesDavid A. Greene, Feb 18, 2013
  5. 3/8 contrib/subtree: Ignore testing directoryDavid A. Greene, Feb 18, 2013
  6. Junio C HamanoFeb 18, 2013
  7. 4/8 contrib/subtree: Code cleaning and refactoringDavid A. Greene, Feb 18, 2013
  8. Junio C HamanoFeb 18, 2013
  9. 5/8 contrib/subtree: Make each test self-containedDavid A. Greene, Feb 18, 2013
  10. 6/8 contrib/subtree: Handle '--prefix' argument with a slash appendedDavid A. Greene, Feb 18, 2013
  11. 7/8 contrib/subtree: Remove --annotateDavid A. Greene, Feb 18, 2013
  12. 8/8 Remove test artifaces from clean ruleDavid A. Greene, Feb 18, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.