{"thread":{"id":"41109","subject":"Remote subtree split --annotate","startedAt":"2016-01-02T20:36:23Z","lastAt":"2016-01-04T15:53:17Z","messageCount":4,"participants":["David Greene","Sebastian Schuberth","greened@obbligato.org"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"275269","messageId":"1451766984-4648-1-git-send-email-greened@obbligato.org","threadId":"41109","inReplyTo":null,"subject":"Remote subtree split --annotate","fromName":"David Greene","fromEmail":"greened@obbligato.org","sentAt":"2016-01-02T20:36:23Z","receivedAt":"2016-01-02T20:36:23Z","isPatch":false,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"This is a fairly simple patch to remove subtree's split --annotate\noption.  The intent of the option is to mark commits split from\na subdirectory but git has other tools more suitable for editing\ncommit messages.  Given --annotate an --unannotate feature seems\nobvious and in fact was requested at one point.  Discussion ensued\nand it became clear that the definition of --unannotate is not\nobvious given the multitude of ways one might want to rewrite a\ncommit message.\n\nSince it is simple to run other git commit message rewriting tools\non commits split from a subdirectory, it seems best to just\nget git-subtree out of the commit rewriting business altogether.\n"},{"id":"275270","messageId":"1451766984-4648-2-git-send-email-greened@obbligato.org","threadId":"41109","inReplyTo":"1451766984-4648-1-git-send-email-greened@obbligato.org","subject":"[PATCH] contrib/subtree: Remove --annotate","fromName":"David Greene","fromEmail":"greened@obbligato.org","sentAt":"2016-01-02T20:36:24Z","receivedAt":"2016-01-02T20:36:24Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: \"David A. Greene\" <greened@obbligato.org>\n\nRemove --annotate.  This obviates the need for an --unannotate\ncommand, which is both an obvious addition and difficult to define\ndue to the numerous ways one might want to specify how to edit\ncommit messages.  git has other tools more suited to rewriting\ncommit messages and it's easy enough to use them after a subtree\nsplit.\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.sh     |  6 +----\n contrib/subtree/t/t7900-subtree.sh | 50 +++++++++++++++++++-------------------\n 2 files changed, 26 insertions(+), 30 deletions(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex edf36f8..699c954 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -21,7 +21,6 @@ d             show debug messages\n P,prefix=     the name of the subdir to split out\n m,message=    use the given message as the commit message for the merge commit\n  options for 'split'\n-annotate=     add a prefix to commit message of new commits\n b,branch=     create a new branch from the split subtree\n ignore-joins  ignore prior --rejoin commits\n onto=         try connecting new tree to an existing one\n@@ -43,7 +42,6 @@ command=\n onto=\n rejoin=\n ignore_joins=\n-annotate=\n squash=\n message=\n prefix=\n@@ -87,8 +85,6 @@ while [ $# -gt 0 ]; do\n \tcase \"$opt\" in\n \t\t-q) quiet=1 ;;\n \t\t-d) debug=1 ;;\n-\t\t--annotate) annotate=\"$1\"; shift ;;\n-\t\t--no-annotate) annotate= ;;\n \t\t-b) branch=\"$1\"; shift ;;\n \t\t-P) prefix=\"${1%/}\"; shift ;;\n \t\t-m) message=\"$1\"; shift ;;\n@@ -319,7 +315,7 @@ copy_commit()\n \t\t\tGIT_COMMITTER_NAME \\\n \t\t\tGIT_COMMITTER_EMAIL \\\n \t\t\tGIT_COMMITTER_DATE\n-\t\t(printf \"%s\" \"$annotate\"; cat ) |\n+\t\t(echo -n \"\"; cat ) |\n \t\tgit commit-tree \"$2\" $3  # reads the rest of stdin\n \t) || die \"Can't copy commit $1\"\n }\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 751aee3..521c401 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -340,8 +340,8 @@ test_expect_success 'split sub dir/ with --rejoin' '\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\" --annotate=\"*\") &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --rejoin &&\n+\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\") &&\n+\t\tgit subtree split --prefix=\"sub dir\" --rejoin &&\n \t\tcheck_equal \"$(last_commit_message)\" \"Split '\\''sub dir/'\\'' into commit '\\''$split_hash'\\''\"\n \t)\n  '\n@@ -365,7 +365,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --message=\"Split & rejoin\" --annotate=\"*\" --rejoin &&\n+\t\tgit subtree split --prefix=\"sub dir\" --message=\"Split & rejoin\" --rejoin &&\n \t\tcheck_equal \"$(last_commit_message)\" \"Split & rejoin\"\n \t)\n '\n@@ -389,8 +389,8 @@ test_expect_success 'split \"sub dir\"/ with --branch' '\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\" --annotate=\"*\") &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br &&\n+\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\") &&\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br &&\n \t\tcheck_equal \"$(git rev-parse subproj-br)\" \"$split_hash\"\n \t)\n '\n@@ -414,8 +414,8 @@ test_expect_success 'check hash of split' '\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\" --annotate=\"*\") &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br &&\n+\t\tsplit_hash=$(git subtree split --prefix=\"sub dir\") &&\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br &&\n \t\tcheck_equal \"$(git rev-parse subproj-br)\" \"$split_hash\" &&\n \t\t# Check hash of split\n \t\tnew_hash=$(git rev-parse subproj-br^2) &&\n@@ -500,7 +500,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -512,12 +512,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n@@ -566,7 +566,7 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -578,12 +578,12 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n@@ -631,7 +631,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -643,12 +643,12 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n@@ -704,7 +704,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -716,12 +716,12 @@ test_expect_success 'make sure each filename changed exactly once in the entire\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n@@ -785,7 +785,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -797,12 +797,12 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n@@ -835,7 +835,7 @@ test_expect_success 'make sure no \"git subtree\" tagged commits make it into subp\n \t\tcd \"$subtree_test_count\" &&\n \t\tgit fetch ./\"sub proj\" master &&\n \t\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub3 &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub3 &&\n@@ -847,12 +847,12 @@ test_expect_success 'make sure no \"git subtree\" tagged commits make it into subp\n \ttest_create_commit \"$subtree_test_count/sub proj\" sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \ttest_create_commit \"$subtree_test_count\" \"sub dir\"/main-sub4 &&\n \t(\n \t\tcd \"$subtree_test_count\" &&\n-\t\tgit subtree split --prefix=\"sub dir\" --annotate=\"*\" --branch subproj-br --rejoin\n+\t\tgit subtree split --prefix=\"sub dir\" --branch subproj-br --rejoin\n \t) &&\n \t(\n \t\tcd \"$subtree_test_count/sub proj\" &&\n-- \n2.6.1\n"},{"id":"275273","messageId":"CAHGBnuMtmUx_NwETPv+xU23PG8vmWm6jWpoRXc9+2qXok5Ak4w@mail.gmail.com","threadId":"41109","inReplyTo":"1451766984-4648-2-git-send-email-greened@obbligato.org","subject":"Re: [PATCH] contrib/subtree: Remove --annotate","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2016-01-03T09:06:36Z","receivedAt":"2016-01-03T09:06:36Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Sat, Jan 2, 2016 at 9:36 PM, David Greene <greened@obbligato.org> wrote:\n\n> commit messages.  git has other tools more suited to rewriting\n> commit messages and it's easy enough to use them after a subtree\n> split.\n\nFor completeness, it probably would be a good idea to name examples\nfor such more suitable tools as part of the commit message.\n\n-- \nSebastian Schuberth\n"},{"id":"275307","messageId":"nng1t9xxrwy.fsf@lnx-dag.us.cray.com","threadId":"41109","inReplyTo":"CAHGBnuMtmUx_NwETPv+xU23PG8vmWm6jWpoRXc9+2qXok5Ak4w@mail.gmail.com","subject":"Re: [PATCH] contrib/subtree: Remove --annotate","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2016-01-04T15:53:17Z","receivedAt":"2016-01-04T15:53:17Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> On Sat, Jan 2, 2016 at 9:36 PM, David Greene <greened@obbligato.org> wrote:\n>\n>> commit messages.  git has other tools more suited to rewriting\n>> commit messages and it's easy enough to use them after a subtree\n>> split.\n>\n> For completeness, it probably would be a good idea to name examples\n> for such more suitable tools as part of the commit message.\n\nOk, that makes sense.\n\n                        -David\n"}]}