git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Greene <greened@obbligato.org>
To: git@vger.kernel.org
Cc: techlivezheng@gmail.com, alex.crezoff@gmail.com,
	davvid@gmail.com, cbailey32@bloomberg.net, danny0838@gmail.com,
	prohaska@zib.de, th.acker@arcor.de, sschuberth@gmail.com,
	peff@peff.net, gitter.spiros@gmail.com, nod.helm@gmail.com,
	gitster@pobox.com, "David A. Greene" <greened@obbligato.org>
Subject: [PATCH] contrib/subtree: Remove --annotate
Date: Sat,  2 Jan 2016 14:36:24 -0600	[thread overview]
Message-ID: <1451766984-4648-2-git-send-email-greened@obbligato.org> (raw)
In-Reply-To: <1451766984-4648-1-git-send-email-greened@obbligato.org>

From: "David A. Greene" <greened@obbligato.org>

Remove --annotate.  This obviates the need for an --unannotate
command, which is both an obvious addition and difficult to define
due to the numerous ways one might want to specify how to edit
commit messages.  git has other tools more suited to rewriting
commit messages and it's easy enough to use them after a subtree
split.

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 edf36f8..699c954 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=
 prefix=
@@ -87,8 +85,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 ;;
@@ -319,7 +315,7 @@ copy_commit()
 			GIT_COMMITTER_NAME \
 			GIT_COMMITTER_EMAIL \
 			GIT_COMMITTER_DATE
-		(printf "%s" "$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 751aee3..521c401 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -340,8 +340,8 @@ test_expect_success 'split sub dir/ with --rejoin' '
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
-		git subtree split --prefix="sub dir" --annotate="*" --rejoin &&
+		split_hash=$(git subtree split --prefix="sub dir") &&
+		git subtree split --prefix="sub dir" --rejoin &&
 		check_equal "$(last_commit_message)" "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
 	)
  '
@@ -365,7 +365,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --message="Split & rejoin" --annotate="*" --rejoin &&
+		git subtree split --prefix="sub dir" --message="Split & rejoin" --rejoin &&
 		check_equal "$(last_commit_message)" "Split & rejoin"
 	)
 '
@@ -389,8 +389,8 @@ test_expect_success 'split "sub dir"/ with --branch' '
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br &&
+		split_hash=$(git subtree split --prefix="sub dir") &&
+		git subtree split --prefix="sub dir" --branch subproj-br &&
 		check_equal "$(git rev-parse subproj-br)" "$split_hash"
 	)
 '
@@ -414,8 +414,8 @@ test_expect_success 'check hash of split' '
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br &&
+		split_hash=$(git subtree split --prefix="sub dir") &&
+		git subtree split --prefix="sub dir" --branch subproj-br &&
 		check_equal "$(git rev-parse subproj-br)" "$split_hash" &&
 		# Check hash of split
 		new_hash=$(git rev-parse subproj-br^2) &&
@@ -500,7 +500,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -512,12 +512,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
@@ -566,7 +566,7 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -578,12 +578,12 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
@@ -631,7 +631,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -643,12 +643,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
@@ -704,7 +704,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -716,12 +716,12 @@ test_expect_success 'make sure each filename changed exactly once in the entire
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
@@ -785,7 +785,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -797,12 +797,12 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
@@ -835,7 +835,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
 		cd "$subtree_test_count" &&
 		git fetch ./"sub proj" master &&
 		git subtree merge --prefix="sub dir" FETCH_HEAD &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count/sub proj" sub3 &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -847,12 +847,12 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
 	test_create_commit "$subtree_test_count/sub proj" sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	test_create_commit "$subtree_test_count" "sub dir"/main-sub4 &&
 	(
 		cd "$subtree_test_count" &&
-		git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
+		git subtree split --prefix="sub dir" --branch subproj-br --rejoin
 	) &&
 	(
 		cd "$subtree_test_count/sub proj" &&
-- 
2.6.1

  reply	other threads:[~2016-01-02 20:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02 20:36 Remote subtree split --annotate David Greene
2016-01-02 20:36 ` David Greene [this message]
2016-01-03  9:06   ` [PATCH] contrib/subtree: Remove --annotate Sebastian Schuberth
2016-01-04 15:53     ` greened
  -- strict thread matches above, loose matches on Subject: below --
2016-01-05  3:05 [PATCH v2] Remote subtree split --annotate David Greene
2016-01-05  3:05 ` [PATCH] contrib/subtree: Remove --annotate David Greene
2016-01-05 17:33   ` Junio C Hamano
2016-01-05 21:35     ` David A. Greene
2016-01-15 18:54       ` Junio C Hamano
2016-01-17 23:30         ` David A. Greene
2016-01-18  1:29           ` Junio C Hamano
2016-06-28 11:10             ` David A. Greene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451766984-4648-2-git-send-email-greened@obbligato.org \
    --to=greened@obbligato.org \
    --cc=alex.crezoff@gmail.com \
    --cc=cbailey32@bloomberg.net \
    --cc=danny0838@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gitter.spiros@gmail.com \
    --cc=nod.helm@gmail.com \
    --cc=peff@peff.net \
    --cc=prohaska@zib.de \
    --cc=sschuberth@gmail.com \
    --cc=techlivezheng@gmail.com \
    --cc=th.acker@arcor.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).