{"thread":{"id":"32493","subject":"git-subtree Patches to Apply","startedAt":"2013-01-01T03:57:27Z","lastAt":"2013-01-22T16:04:32Z","messageCount":38,"participants":["David A. Greene","greened@obbligato.org","Junio C Hamano","郑文辉 (Techlive Zheng)","James Nylen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205744","messageId":"1357012655-24974-1-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":null,"subject":"git-subtree Patches to Apply","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:27Z","receivedAt":"2013-01-01T03:57:27Z","isPatch":false,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Here are all of the patches for git-subtree that have been posted to\nthe mailing list that I could apply and test in a reasonable amount of\ntime.  These are all rebased from trunk as of tonight.\n\nMany apologies for being *so* behind.  Work has been a bear but I'm\nhoping things will ease up in the new year and I can be more regularly\nactive.  But still, don't expect same-day service.  :)\n\nThese are also available on branch \"toupstream\" via\n\ngit clone gitolite@sources.obbligato.org:git.git\n\nand\n\nhttp://sources.obbligato.org\nhttp://sources.obbligato.org/?p=git.git;a=summary\n\nJunio, can you apply these?  Thanks!\n\n                     -David\n"},{"id":"205745","messageId":"1357012655-24974-2-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 1/8] Use %B for Split Subject/Body","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:28Z","receivedAt":"2013-01-01T03:57:28Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: Techlive Zheng <techlivezheng@gmail.com>\n\nUse %B to format the commit message and body to avoid an extra newline\nif a commit only has a subject line.\n\nAuthor:    Techlive Zheng <techlivezheng@gmail.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.sh     |    5 +++\n contrib/subtree/t/t7900-subtree.sh |   73 ++++++++++++++++++++++--------------\n 2 files changed, 49 insertions(+), 29 deletions(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 920c664..f2b6d4a 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -296,7 +296,12 @@ copy_commit()\n \t# We're going to set some environment vars here, so\n \t# do it in a subshell to get rid of them safely later\n \tdebug copy_commit \"{$1}\" \"{$2}\" \"{$3}\"\n+\t# Use %B rather than %s%n%n%b to handle the special case of a\n+\t# commit that only has a subject line.  We don't want to\n+\t# introduce a newline after the subject, causing generation of\n+\t# a new hash.\n \tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b' \"$1\" |\n+#\tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' \"$1\" |\n \t(\n \t\tread GIT_AUTHOR_NAME\n \t\tread GIT_AUTHOR_EMAIL\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex bc2eeb0..93eeb09 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -76,6 +76,10 @@ test_expect_success 'add sub1' '\n         git branch -m master subproj\n '\n \n+# Save this hash for testing later.\n+\n+subdir_hash=`git rev-parse HEAD`\n+\n # 3\n test_expect_success 'add sub2' '\n         create sub2 &&\n@@ -155,7 +159,6 @@ test_expect_success 'add main-sub5' '\n         create subdir/main-sub5 &&\n         git commit -m \"main-sub5\"\n '\n-\n # 15\n test_expect_success 'add main6' '\n         create main6 &&\n@@ -235,7 +238,19 @@ test_expect_success 'check split with --branch' '\n         check_equal ''\"$(git rev-parse splitbr1)\"'' \"$spl1\"\n '\n \n-# 25\n+#25\n+test_expect_success 'check hash of split' '\n+        spl1=$(git subtree split --prefix subdir) &&\n+        undo &&\n+        git subtree split --prefix subdir --branch splitbr1test &&\n+        check_equal ''\"$(git rev-parse splitbr1test)\"'' \"$spl1\"\n+        git checkout splitbr1test &&\n+        new_hash=$(git rev-parse HEAD~2) &&\n+        git checkout mainline &&\n+        check_equal ''\"$new_hash\"'' \"$subdir_hash\"\n+'\n+\n+# 26\n test_expect_success 'check split with --branch for an existing branch' '\n         spl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n         undo &&\n@@ -244,13 +259,13 @@ test_expect_success 'check split with --branch for an existing branch' '\n         check_equal ''\"$(git rev-parse splitbr2)\"'' \"$spl1\"\n '\n \n-# 26\n+# 27\n test_expect_success 'check split with --branch for an incompatible branch' '\n         test_must_fail git subtree split --prefix subdir --onto FETCH_HEAD --branch subdir\n '\n \n \n-# 27\n+# 28\n test_expect_success 'check split+rejoin' '\n         spl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n         undo &&\n@@ -258,7 +273,7 @@ test_expect_success 'check split+rejoin' '\n         check_equal ''\"$(last_commit_message)\"'' \"Split '\"'\"'subdir/'\"'\"' into commit '\"'\"'\"$spl1\"'\"'\"'\"\n '\n \n-# 28\n+# 29\n test_expect_success 'add main-sub8' '\n         create subdir/main-sub8 &&\n         git commit -m \"main-sub8\"\n@@ -267,14 +282,14 @@ test_expect_success 'add main-sub8' '\n # To the subproject!\n cd ./subproj\n \n-# 29\n+# 30\n test_expect_success 'merge split into subproj' '\n         git fetch .. spl1 &&\n         git branch spl1 FETCH_HEAD &&\n         git merge FETCH_HEAD\n '\n \n-# 30\n+# 31\n test_expect_success 'add sub9' '\n         create sub9 &&\n         git commit -m \"sub9\"\n@@ -283,19 +298,19 @@ test_expect_success 'add sub9' '\n # Back to mainline\n cd ..\n \n-# 31\n+# 32\n test_expect_success 'split for sub8' '\n         split2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"''\n         git branch split2 \"$split2\"\n '\n \n-# 32\n+# 33\n test_expect_success 'add main-sub10' '\n         create subdir/main-sub10 &&\n         git commit -m \"main-sub10\"\n '\n \n-# 33\n+# 34\n test_expect_success 'split for sub10' '\n         spl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --rejoin)\"'' &&\n         git branch spl3 \"$spl3\"\n@@ -304,7 +319,7 @@ test_expect_success 'split for sub10' '\n # To the subproject!\n cd ./subproj\n \n-# 34\n+# 35\n test_expect_success 'merge split into subproj' '\n         git fetch .. spl3 &&\n         git branch spl3 FETCH_HEAD &&\n@@ -318,13 +333,13 @@ chkms_sub=$(echo $chkms | multiline | sed 's,^,subdir/,' | fixnl)\n chks=\"sub1 sub2 sub3 sub9\"\n chks_sub=$(echo $chks | multiline | sed 's,^,subdir/,' | fixnl)\n \n-# 35\n+# 36\n test_expect_success 'make sure exactly the right set of files ends up in the subproj' '\n         subfiles=''\"$(git ls-files | fixnl)\"'' &&\n         check_equal \"$subfiles\" \"$chkms $chks\"\n '\n \n-# 36\n+# 37\n test_expect_success 'make sure the subproj history *only* contains commits that affect the subdir' '\n         allchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n         check_equal \"$allchanges\" \"$chkms $chks\"\n@@ -333,20 +348,20 @@ test_expect_success 'make sure the subproj history *only* contains commits that\n # Back to mainline\n cd ..\n \n-# 37\n+# 38\n test_expect_success 'pull from subproj' '\n         git fetch ./subproj subproj-merge-spl3 &&\n         git branch subproj-merge-spl3 FETCH_HEAD &&\n         git subtree pull --prefix=subdir ./subproj subproj-merge-spl3\n '\n \n-# 38\n+# 39\n test_expect_success 'make sure exactly the right set of files ends up in the mainline' '\n         mainfiles=''\"$(git ls-files | fixnl)\"'' &&\n         check_equal \"$mainfiles\" \"$chkm $chkms_sub $chks_sub\"\n '\n \n-# 39\n+# 40\n test_expect_success 'make sure each filename changed exactly once in the entire history' '\n         # main-sub?? and /subdir/main-sub?? both change, because those are the\n         # changes that were split into their own history.  And subdir/sub?? never\n@@ -355,12 +370,12 @@ test_expect_success 'make sure each filename changed exactly once in the entire\n         check_equal \"$allchanges\" ''\"$(echo $chkms $chkm $chks $chkms_sub | multiline | sort | fixnl)\"''\n '\n \n-# 40\n+# 41\n test_expect_success 'make sure the --rejoin commits never make it into subproj' '\n         check_equal ''\"$(git log --pretty=format:'\"'%s'\"' HEAD^2 | grep -i split)\"'' \"\"\n '\n \n-# 41\n+# 42\n test_expect_success 'make sure no \"git subtree\" tagged commits make it into subproj' '\n         # They are meaningless to subproj since one side of the merge refers to the mainline\n         check_equal ''\"$(git log --pretty=format:'\"'%s%n%b'\"' HEAD^2 | grep \"git-subtree.*:\")\"'' \"\"\n@@ -370,14 +385,14 @@ test_expect_success 'make sure no \"git subtree\" tagged commits make it into subp\n mkdir test2\n cd test2\n \n-# 42\n+# 43\n test_expect_success 'init main' '\n         test_create_repo main\n '\n \n cd main\n \n-# 43\n+# 44\n test_expect_success 'add main1' '\n         create main1 &&\n         git commit -m \"main1\"\n@@ -385,14 +400,14 @@ test_expect_success 'add main1' '\n \n cd ..\n \n-# 44\n+# 45\n test_expect_success 'init sub' '\n         test_create_repo sub\n '\n \n cd sub\n \n-# 45\n+# 46\n test_expect_success 'add sub2' '\n         create sub2 &&\n         git commit -m \"sub2\"\n@@ -402,7 +417,7 @@ cd ../main\n \n # check if split can find proper base without --onto\n \n-# 46\n+# 47\n test_expect_success 'add sub as subdir in main' '\n         git fetch ../sub master &&\n         git branch sub2 FETCH_HEAD &&\n@@ -411,7 +426,7 @@ test_expect_success 'add sub as subdir in main' '\n \n cd ../sub\n \n-# 47\n+# 48\n test_expect_success 'add sub3' '\n         create sub3 &&\n         git commit -m \"sub3\"\n@@ -419,20 +434,20 @@ test_expect_success 'add sub3' '\n \n cd ../main\n \n-# 48\n+# 49\n test_expect_success 'merge from sub' '\n         git fetch ../sub master &&\n         git branch sub3 FETCH_HEAD &&\n         git subtree merge --prefix subdir sub3\n '\n \n-# 49\n+# 50\n test_expect_success 'add main-sub4' '\n         create subdir/main-sub4 &&\n         git commit -m \"main-sub4\"\n '\n \n-# 50\n+# 51\n test_expect_success 'split for main-sub4 without --onto' '\n         git subtree split --prefix subdir --branch mainsub4\n '\n@@ -442,12 +457,12 @@ test_expect_success 'split for main-sub4 without --onto' '\n # have been sub3, but it was not, because its cache was not set to\n # itself)\n \n-# 51\n+# 52\n test_expect_success 'check that the commit parent is sub3' '\n         check_equal ''\"$(git log --pretty=format:%P -1 mainsub4)\"'' ''\"$(git rev-parse sub3)\"''\n '\n \n-# 52\n+# 53\n test_expect_success 'add main-sub5' '\n         mkdir subdir2 &&\n         create subdir2/main-sub5 &&\n-- \n1.7.10.4\n"},{"id":"205747","messageId":"1357012655-24974-3-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 2/8] Add --unannotate","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:29Z","receivedAt":"2013-01-01T03:57:29Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: James Nylen <jnylen@gmail.com>\n\nTeach git-subtree about --unannotate.  This option strips a prefix\nfrom a commit message when doing a subtree split.\n\nAuthor:    James Nylen <jnylen@gmail.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.sh     |   11 +++++-\n contrib/subtree/git-subtree.txt    |   15 ++++++++\n contrib/subtree/t/t7900-subtree.sh |   73 ++++++++++++++++++++----------------\n 3 files changed, 65 insertions(+), 34 deletions(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex f2b6d4a..7ceb413 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -21,6 +21,7 @@ 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+unannotate=   remove a prefix from new commit messages (supports bash globbing)\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,6 +44,7 @@ onto=\n rejoin=\n ignore_joins=\n annotate=\n+unannotate=\n squash=\n message=\n \n@@ -80,6 +82,8 @@ while [ $# -gt 0 ]; do\n \t\t-d) debug=1 ;;\n \t\t--annotate) annotate=\"$1\"; shift ;;\n \t\t--no-annotate) annotate= ;;\n+\t\t--unannotate) unannotate=\"$1\"; shift ;;\n+\t\t--no-unannotate) unannotate= ;;\n \t\t-b) branch=\"$1\"; shift ;;\n \t\t-P) prefix=\"$1\"; shift ;;\n \t\t-m) message=\"$1\"; shift ;;\n@@ -315,8 +319,11 @@ copy_commit()\n \t\t\tGIT_COMMITTER_NAME \\\n \t\t\tGIT_COMMITTER_EMAIL \\\n \t\t\tGIT_COMMITTER_DATE\n-\t\t(echo -n \"$annotate\"; cat ) |\n-\t\tgit commit-tree \"$2\" $3  # reads the rest of stdin\n+\t\t(\n+\t\t\tread FIRST_LINE\n+\t\t\techo \"$annotate${FIRST_LINE#$unannotate}\"\n+\t\t\tcat  # reads the rest of stdin\n+\t\t) | git commit-tree \"$2\" $3\n \t) || die \"Can't copy commit $1\"\n }\n \ndiff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\nindex 0c44fda..ae420aa 100644\n--- a/contrib/subtree/git-subtree.txt\n+++ b/contrib/subtree/git-subtree.txt\n@@ -198,6 +198,21 @@ OPTIONS FOR split\n \tgit subtree tries to make it work anyway, particularly\n \tif you use --rejoin, but it may not always be effective.\n \n+--unannotate=<annotation>::\n+\tThis option is only valid for the split command.\n+\n+\tWhen generating synthetic history, try to remove the prefix\n+\t<annotation> from each commit message (using bash's \"strip\n+\tshortest match from beginning\" command, which supports\n+\tglobbing).  This makes sense if you format library commits\n+\tlike \"library: Change something or other\" when you're working\n+\tin your project's repository, but you want to remove this\n+\tprefix when pushing back to the library's upstream repository.\n+\t(In this case --unannotate='*: ' would work well.)\n+\t\n+\tLike --annotate,  you need to use the same <annotation>\n+\twhenever you split, or you may run into problems.\n+\n -b <branch>::\n --branch=<branch>::\n \tThis option is only valid for the split command.\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 93eeb09..9816da5 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -157,7 +157,7 @@ test_expect_success 'merge fetched subproj' '\n # 14\n test_expect_success 'add main-sub5' '\n         create subdir/main-sub5 &&\n-        git commit -m \"main-sub5\"\n+        git commit -m \"subproj: main-sub5\"\n '\n # 15\n test_expect_success 'add main6' '\n@@ -168,7 +168,7 @@ test_expect_success 'add main6' '\n # 16\n test_expect_success 'add main-sub7' '\n         create subdir/main-sub7 &&\n-        git commit -m \"main-sub7\"\n+        git commit -m \"subproj: main-sub7\"\n '\n \n # 17\n@@ -238,7 +238,7 @@ test_expect_success 'check split with --branch' '\n         check_equal ''\"$(git rev-parse splitbr1)\"'' \"$spl1\"\n '\n \n-#25\n+# 25\n test_expect_success 'check hash of split' '\n         spl1=$(git subtree split --prefix subdir) &&\n         undo &&\n@@ -251,6 +251,15 @@ test_expect_success 'check hash of split' '\n '\n \n # 26\n+test_expect_success 'check --unannotate' '\n+        spl1=$(git subtree split --unannotate='\"subproj:\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin) &&\n+        undo &&\n+        git subtree split --unannotate='\"subproj:\"' --prefix subdir --onto FETCH_HEAD --branch splitunann &&\n+        check_equal ''\"$(git rev-parse splitunann)\"'' \"$spl1\" &&\n+        check_equal ''\"$(git log splitunann | grep subproj)\"'' \"\"\n+'\n+\n+# 27\n test_expect_success 'check split with --branch for an existing branch' '\n         spl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n         undo &&\n@@ -259,13 +268,13 @@ test_expect_success 'check split with --branch for an existing branch' '\n         check_equal ''\"$(git rev-parse splitbr2)\"'' \"$spl1\"\n '\n \n-# 27\n+# 28\n test_expect_success 'check split with --branch for an incompatible branch' '\n         test_must_fail git subtree split --prefix subdir --onto FETCH_HEAD --branch subdir\n '\n \n \n-# 28\n+# 29\n test_expect_success 'check split+rejoin' '\n         spl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n         undo &&\n@@ -273,7 +282,7 @@ test_expect_success 'check split+rejoin' '\n         check_equal ''\"$(last_commit_message)\"'' \"Split '\"'\"'subdir/'\"'\"' into commit '\"'\"'\"$spl1\"'\"'\"'\"\n '\n \n-# 29\n+# 30\n test_expect_success 'add main-sub8' '\n         create subdir/main-sub8 &&\n         git commit -m \"main-sub8\"\n@@ -282,14 +291,14 @@ test_expect_success 'add main-sub8' '\n # To the subproject!\n cd ./subproj\n \n-# 30\n+# 31\n test_expect_success 'merge split into subproj' '\n         git fetch .. spl1 &&\n         git branch spl1 FETCH_HEAD &&\n         git merge FETCH_HEAD\n '\n \n-# 31\n+# 32\n test_expect_success 'add sub9' '\n         create sub9 &&\n         git commit -m \"sub9\"\n@@ -298,19 +307,19 @@ test_expect_success 'add sub9' '\n # Back to mainline\n cd ..\n \n-# 32\n+# 33\n test_expect_success 'split for sub8' '\n         split2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"''\n         git branch split2 \"$split2\"\n '\n \n-# 33\n+# 34\n test_expect_success 'add main-sub10' '\n         create subdir/main-sub10 &&\n         git commit -m \"main-sub10\"\n '\n \n-# 34\n+# 35\n test_expect_success 'split for sub10' '\n         spl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --rejoin)\"'' &&\n         git branch spl3 \"$spl3\"\n@@ -319,7 +328,7 @@ test_expect_success 'split for sub10' '\n # To the subproject!\n cd ./subproj\n \n-# 35\n+# 36\n test_expect_success 'merge split into subproj' '\n         git fetch .. spl3 &&\n         git branch spl3 FETCH_HEAD &&\n@@ -333,13 +342,13 @@ chkms_sub=$(echo $chkms | multiline | sed 's,^,subdir/,' | fixnl)\n chks=\"sub1 sub2 sub3 sub9\"\n chks_sub=$(echo $chks | multiline | sed 's,^,subdir/,' | fixnl)\n \n-# 36\n+# 37\n test_expect_success 'make sure exactly the right set of files ends up in the subproj' '\n         subfiles=''\"$(git ls-files | fixnl)\"'' &&\n         check_equal \"$subfiles\" \"$chkms $chks\"\n '\n \n-# 37\n+# 38\n test_expect_success 'make sure the subproj history *only* contains commits that affect the subdir' '\n         allchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n         check_equal \"$allchanges\" \"$chkms $chks\"\n@@ -348,20 +357,20 @@ test_expect_success 'make sure the subproj history *only* contains commits that\n # Back to mainline\n cd ..\n \n-# 38\n+# 39\n test_expect_success 'pull from subproj' '\n         git fetch ./subproj subproj-merge-spl3 &&\n         git branch subproj-merge-spl3 FETCH_HEAD &&\n         git subtree pull --prefix=subdir ./subproj subproj-merge-spl3\n '\n \n-# 39\n+# 40\n test_expect_success 'make sure exactly the right set of files ends up in the mainline' '\n         mainfiles=''\"$(git ls-files | fixnl)\"'' &&\n         check_equal \"$mainfiles\" \"$chkm $chkms_sub $chks_sub\"\n '\n \n-# 40\n+# 41\n test_expect_success 'make sure each filename changed exactly once in the entire history' '\n         # main-sub?? and /subdir/main-sub?? both change, because those are the\n         # changes that were split into their own history.  And subdir/sub?? never\n@@ -370,12 +379,12 @@ test_expect_success 'make sure each filename changed exactly once in the entire\n         check_equal \"$allchanges\" ''\"$(echo $chkms $chkm $chks $chkms_sub | multiline | sort | fixnl)\"''\n '\n \n-# 41\n+# 42\n test_expect_success 'make sure the --rejoin commits never make it into subproj' '\n         check_equal ''\"$(git log --pretty=format:'\"'%s'\"' HEAD^2 | grep -i split)\"'' \"\"\n '\n \n-# 42\n+# 43\n test_expect_success 'make sure no \"git subtree\" tagged commits make it into subproj' '\n         # They are meaningless to subproj since one side of the merge refers to the mainline\n         check_equal ''\"$(git log --pretty=format:'\"'%s%n%b'\"' HEAD^2 | grep \"git-subtree.*:\")\"'' \"\"\n@@ -385,14 +394,14 @@ test_expect_success 'make sure no \"git subtree\" tagged commits make it into subp\n mkdir test2\n cd test2\n \n-# 43\n+# 44\n test_expect_success 'init main' '\n         test_create_repo main\n '\n \n cd main\n \n-# 44\n+# 45\n test_expect_success 'add main1' '\n         create main1 &&\n         git commit -m \"main1\"\n@@ -400,14 +409,14 @@ test_expect_success 'add main1' '\n \n cd ..\n \n-# 45\n+# 46\n test_expect_success 'init sub' '\n         test_create_repo sub\n '\n \n cd sub\n \n-# 46\n+# 47\n test_expect_success 'add sub2' '\n         create sub2 &&\n         git commit -m \"sub2\"\n@@ -417,7 +426,7 @@ cd ../main\n \n # check if split can find proper base without --onto\n \n-# 47\n+# 48\n test_expect_success 'add sub as subdir in main' '\n         git fetch ../sub master &&\n         git branch sub2 FETCH_HEAD &&\n@@ -426,7 +435,7 @@ test_expect_success 'add sub as subdir in main' '\n \n cd ../sub\n \n-# 48\n+# 49\n test_expect_success 'add sub3' '\n         create sub3 &&\n         git commit -m \"sub3\"\n@@ -434,20 +443,20 @@ test_expect_success 'add sub3' '\n \n cd ../main\n \n-# 49\n+# 50\n test_expect_success 'merge from sub' '\n         git fetch ../sub master &&\n         git branch sub3 FETCH_HEAD &&\n         git subtree merge --prefix subdir sub3\n '\n \n-# 50\n+# 51\n test_expect_success 'add main-sub4' '\n         create subdir/main-sub4 &&\n         git commit -m \"main-sub4\"\n '\n \n-# 51\n+# 52\n test_expect_success 'split for main-sub4 without --onto' '\n         git subtree split --prefix subdir --branch mainsub4\n '\n@@ -457,19 +466,19 @@ test_expect_success 'split for main-sub4 without --onto' '\n # have been sub3, but it was not, because its cache was not set to\n # itself)\n \n-# 52\n+# 53\n test_expect_success 'check that the commit parent is sub3' '\n         check_equal ''\"$(git log --pretty=format:%P -1 mainsub4)\"'' ''\"$(git rev-parse sub3)\"''\n '\n \n-# 53\n+# 54\n test_expect_success 'add main-sub5' '\n         mkdir subdir2 &&\n         create subdir2/main-sub5 &&\n         git commit -m \"main-sub5\"\n '\n \n-# 53\n+# 55\n test_expect_success 'split for main-sub5 without --onto' '\n         # also test that we still can split out an entirely new subtree\n         # if the parent of the first commit in the tree is not empty,\n@@ -502,7 +511,7 @@ joincommits()\n \techo \"$commit $all\"\n }\n \n-# 54\n+# 56\n test_expect_success 'verify one file change per commit' '\n         x= &&\n         list=''\"$(git log --pretty=format:'\"'commit: %H'\"' | joincommits)\"'' &&\n-- \n1.7.10.4\n"},{"id":"205746","messageId":"1357012655-24974-4-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 3/8] Better Error Handling for add","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:30Z","receivedAt":"2013-01-01T03:57:30Z","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\nCheck refspecs for validity before passing them on to other commands.\nThis lets us generate more helpful error messages.\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.sh |   12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 7ceb413..b8a807a 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -509,8 +509,20 @@ cmd_add()\n \tensure_clean\n \t\n \tif [ $# -eq 1 ]; then\n+\t        ref=$(git check-ref-format --normalize \"refs/heads/$1\") ||\n+                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n+\n+\t        rev=$(git rev-parse --verify $1) ||\n+                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n+\n \t\t\"cmd_add_commit\" \"$@\"\n \telif [ $# -eq 2 ]; then\n+\t        ref=$(git check-ref-format --normalize \"refs/heads/$2\") ||\n+                die \"'$2' is not a valid refspec.\"\n+\n+\t        rev=$(git rev-parse --verify $2) ||\n+                die \"'$2' is not a valid refspec.\"\n+\n \t\t\"cmd_add_repository\" \"$@\"\n \telse\n \t    say \"error: parameters were '$@'\"\n-- \n1.7.10.4\n"},{"id":"205748","messageId":"1357012655-24974-5-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 4/8] Fix Synopsis","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:31Z","receivedAt":"2013-01-01T03:57:31Z","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\nFix the documentation of add to show that a repository can be\nspecified along with a commit.\n\nChange \"commit\" to \"refspec\" in the synopsis for add.\n\nSuggested by Yann Dirson <dirson@bertin.fr>.\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.sh  |    3 ++-\n contrib/subtree/git-subtree.txt |    3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex b8a807a..ad62dfb 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -8,7 +8,8 @@ if [ $# -eq 0 ]; then\n     set -- -h\n fi\n OPTS_SPEC=\"\\\n-git subtree add   --prefix=<prefix> <commit>\n+git subtree add   --prefix=<prefix> <refspec>\n+git subtree add   --prefix=<prefix> <repository> <refspec>\n git subtree merge --prefix=<prefix> <commit>\n git subtree pull  --prefix=<prefix> <repository> <refspec...>\n git subtree push  --prefix=<prefix> <repository> <refspec...>\ndiff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\nindex ae420aa..89c2d6e 100644\n--- a/contrib/subtree/git-subtree.txt\n+++ b/contrib/subtree/git-subtree.txt\n@@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees\n SYNOPSIS\n --------\n [verse]\n-'git subtree' add   -P <prefix> <commit>\n+'git subtree' add   -P <prefix> <refspec>\n+'git subtree' add   -P <prefix> <repository> <refspec>\n 'git subtree' pull  -P <prefix> <repository> <refspec...>\n 'git subtree' push  -P <prefix> <repository> <refspec...>\n 'git subtree' merge -P <prefix> <commit>\n-- \n1.7.10.4\n"},{"id":"205752","messageId":"1357012655-24974-6-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 5/8] Honor DESTDIR","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:32Z","receivedAt":"2013-01-01T03:57:32Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: Adam Tkac <atkac@redhat.com>\n\nTeach git-subtree's Makefile to honor DESTDIR.\n\nAuthor:    Adam Tkac <atkac@redhat.com>\n\nSigned-off-by:    Adam Tkac <atkac@redhat.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/Makefile |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\nindex 05cdd5c..36ae3e4 100644\n--- a/contrib/subtree/Makefile\n+++ b/contrib/subtree/Makefile\n@@ -30,12 +30,12 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)\n doc: $(GIT_SUBTREE_DOC)\n \n install: $(GIT_SUBTREE)\n-\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(libexecdir)\n+\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(libexecdir)\n \n install-doc: install-man\n \n install-man: $(GIT_SUBTREE_DOC)\n-\t$(INSTALL) -m 644 $^ $(man1dir)\n+\t$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)\n \n $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)\n \txmlto -m $(MANPAGE_NORMAL_XSL)  man $^\n-- \n1.7.10.4\n"},{"id":"205749","messageId":"1357012655-24974-7-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 6/8] Make the Manual Directory if Needed","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:33Z","receivedAt":"2013-01-01T03:57:33Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: \"Jesper L. Nielsen\" <lyager@gmail.com>\n\nBefore install git-subtree documentation, make sure the manpage\ndirectory exists.\n\nAuthor:    Jesper L. Nielsen <lyager@gmail.com>\n\nSigned-off-by:    Jesper L. Nielsen <lyager@gmail.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/Makefile |    1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\nindex 36ae3e4..52d6fb9 100644\n--- a/contrib/subtree/Makefile\n+++ b/contrib/subtree/Makefile\n@@ -35,6 +35,7 @@ install: $(GIT_SUBTREE)\n install-doc: install-man\n \n install-man: $(GIT_SUBTREE_DOC)\n+\tmkdir -p $(man1dir)\n \t$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)\n \n $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)\n-- \n1.7.10.4\n"},{"id":"205751","messageId":"1357012655-24974-8-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 7/8] Ignore git-subtree","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:34Z","receivedAt":"2013-01-01T03:57:34Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: Michael Schubert <mschub@elegosoft.com>\n\nAdd the git-subtree command executable to .gitignore.\n\nAuthor:    Michael Schubert <mschub@elegosoft.com>\n\nSigned-off-by:    Michael Schubert <mschub@elegosoft.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/.gitignore |    1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/subtree/.gitignore b/contrib/subtree/.gitignore\nindex 7e77c9d..91360a3 100644\n--- a/contrib/subtree/.gitignore\n+++ b/contrib/subtree/.gitignore\n@@ -1,4 +1,5 @@\n *~\n+git-subtree\n git-subtree.xml\n git-subtree.1\n mainline\n-- \n1.7.10.4\n"},{"id":"205750","messageId":"1357012655-24974-9-git-send-email-greened@obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-1-git-send-email-greened@obbligato.org","subject":"[PATCH 8/8] Fix Documentation Typo","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T03:57:35Z","receivedAt":"2013-01-01T03:57:35Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"From: Michael Schubert <mschub@elegosoft.com>\n\n\"split\" is documented below \"push\" so fix the reference to it in\npush's documentation.\n\nAuthor:    Michael Schubert <mschub@elegosoft.com>\n\nSigned-off-by:    Michael Schubert <mschub@elegosoft.com>\n\nSigned-off-by: David A. Greene <greened@obbligato.org>\n---\n contrib/subtree/git-subtree.txt |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\nindex 89c2d6e..078d4ac 100644\n--- a/contrib/subtree/git-subtree.txt\n+++ b/contrib/subtree/git-subtree.txt\n@@ -94,7 +94,7 @@ pull::\n \trepository.\n \t\n push::\n-\tDoes a 'split' (see above) using the <prefix> supplied\n+\tDoes a 'split' (see below) using the <prefix> supplied\n \tand then does a 'git push' to push the result to the \n \trepository and refspec. This can be used to push your\n \tsubtree to different branches of the remote repository.\n-- \n1.7.10.4\n"},{"id":"205755","messageId":"87wqvxv96q.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"1357012655-24974-2-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T04:06:21Z","receivedAt":"2013-01-01T04:06:21Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: Techlive Zheng <techlivezheng@gmail.com>\n>\n> Use %B to format the commit message and body to avoid an extra newline\n> if a commit only has a subject line.\n\nWow.  So that was a spectacular fail.  Sorry about th duplicate patch\ne-mails.  I have no idea how that happened.\n\n                        -David\n"},{"id":"205758","messageId":"7vtxr1bg4g.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-2-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T05:56:47Z","receivedAt":"2013-01-01T05:56:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: Techlive Zheng <techlivezheng@gmail.com>\n>\n> Use %B to format the commit message and body to avoid an extra newline\n> if a commit only has a subject line.\n\nIs this an unconditional improvement, or is it generally an\nimprovement but for some users it may be a regression?  I am\nguessing it is the former but am just making sure.\n\n> Author:    Techlive Zheng <techlivezheng@gmail.com>\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n\nPlease don't do \"Author: \" which does not add anything new.  That is\nwhat \"From: \" is for.  Instead it needs to be a sign-off.\n\nAlso, is that a real name, I have to wonder?\n\nThanks.\n"},{"id":"205759","messageId":"7vpq1pbg1k.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"87wqvxv96q.fsf@waller.obbligato.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T05:58:31Z","receivedAt":"2013-01-01T05:58:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greened@obbligato.org writes:\n\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Use %B to format the commit message and body to avoid an extra newline\n>> if a commit only has a subject line.\n>\n> Wow.  So that was a spectacular fail.  Sorry about th duplicate patch\n> e-mails.  I have no idea how that happened.\n>\n>                         -David\n\nAlso, please be careful about the subject line.  I doubt that these\n8 patches will stand out as relating to \"contrib/subtree\", when mixed\nin 200 line output of \"git shortlog --no-merges\".\n\nThanks.\n"},{"id":"205784","messageId":"7va9ssa94l.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-2-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:25:30Z","receivedAt":"2013-01-01T21:25:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> Subject: Re: [PATCH 1/8] Use %B for Split Subject/Body\n\nThis needs to say \"contrib/subtree\" somewhere (applies to all\npatches in this series).\n\n> From: Techlive Zheng <techlivezheng@gmail.com>\n>\n> Use %B to format the commit message and body to avoid an extra newline\n> if a commit only has a subject line.\n>\n> Author:    Techlive Zheng <techlivezheng@gmail.com>\n\nThis needs to be a S-o-b instead; is it a real name, by the way?\n\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n>  contrib/subtree/git-subtree.sh     |    5 +++\n>  contrib/subtree/t/t7900-subtree.sh |   73 ++++++++++++++++++++++--------------\n>  2 files changed, 49 insertions(+), 29 deletions(-)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index 920c664..f2b6d4a 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -296,7 +296,12 @@ copy_commit()\n>  \t# We're going to set some environment vars here, so\n>  \t# do it in a subshell to get rid of them safely later\n>  \tdebug copy_commit \"{$1}\" \"{$2}\" \"{$3}\"\n> +\t# Use %B rather than %s%n%n%b to handle the special case of a\n> +\t# commit that only has a subject line.  We don't want to\n> +\t# introduce a newline after the subject, causing generation of\n> +\t# a new hash.\n>  \tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b' \"$1\" |\n> +#\tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' \"$1\" |\n\nIs it really replacing %s%n%n%b with %B, or is it still an\nexperiment that is disabled?\n\n>  \t(\n>  \t\tread GIT_AUTHOR_NAME\n>  \t\tread GIT_AUTHOR_EMAIL\n> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\n> index bc2eeb0..93eeb09 100755\n> --- a/contrib/subtree/t/t7900-subtree.sh\n> +++ b/contrib/subtree/t/t7900-subtree.sh\n> @@ -76,6 +76,10 @@ test_expect_success 'add sub1' '\n>          git branch -m master subproj\n>  '\n>  \n> +# Save this hash for testing later.\n> +\n> +subdir_hash=`git rev-parse HEAD`\n> +\n\nWe prefer $() over ``; much more readable.\n\n>  # 3\n>  test_expect_success 'add sub2' '\n>          create sub2 &&\n> @@ -155,7 +159,6 @@ test_expect_success 'add main-sub5' '\n>          create subdir/main-sub5 &&\n>          git commit -m \"main-sub5\"\n>  '\n> -\n>  # 15\n>  test_expect_success 'add main6' '\n>          create main6 &&\n\nWhy?\n\n> @@ -235,7 +238,19 @@ test_expect_success 'check split with --branch' '\n>          check_equal ''\"$(git rev-parse splitbr1)\"'' \"$spl1\"\n\nIs quoting screwed up around here (and in many other places in this\npatch)?  What are these no-op '' doing?\n\n>  '\n>  \n> -# 25\n> +#25\n\nWhy the lossage of a SP?\n\nIt may make sense to lose these \"# num\" that will have to be touched\nevery time somebody inserts new test pieces in the middle, as a\npreparatory step before any of these patches, by the way.  That will\nreduce noise in the patches for real changes.\n"},{"id":"205785","messageId":"7v623ga8vs.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-3-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:30:47Z","receivedAt":"2013-01-01T21:30:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: James Nylen <jnylen@gmail.com>\n>\n> Teach git-subtree about --unannotate.  This option strips a prefix\n> from a commit message when doing a subtree split.\n\nHrm.  This looks like a workaround for a short-sighted misdesign of\nthe annotate option that only allowed prefixing a fixed string.  I\nhave to wonder if it is better to deprecate --annotate and replace\nit with a more general \"commit log rewriting\" facility that can\ncover both use cases?\n"},{"id":"205786","messageId":"7v1ue4a8i0.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-4-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 3/8] Better Error Handling for add","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:39:03Z","receivedAt":"2013-01-01T21:39:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: \"David A. Greene\" <greened@obbligato.org>\n>\n> Check refspecs for validity before passing them on to other commands.\n> This lets us generate more helpful error messages.\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n>  contrib/subtree/git-subtree.sh |   12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index 7ceb413..b8a807a 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -509,8 +509,20 @@ cmd_add()\n>  \tensure_clean\n>  \t\n>  \tif [ $# -eq 1 ]; then\n> +\t        ref=$(git check-ref-format --normalize \"refs/heads/$1\") ||\n> +                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n\nIs a user forbidden from passing a commit that is not at the tip of\nan existing branch?  In other words, is\n\n\t$ subtree add origin/next~4^2\n\nforbidden?\n\n> +\t        rev=$(git rev-parse --verify $1) ||\n> +                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n> +\n>  \t\t\"cmd_add_commit\" \"$@\"\n\nIf you want to make sure you give a comit to add_commit, you can\nprobably say something like this:\n\n\tgit rev-parse -q --verify \"$1^{commit}\" >/dev/null ||\n        die \"'$1' does not refer to a commit\"\n\n>  \telif [ $# -eq 2 ]; then\n> +\t        ref=$(git check-ref-format --normalize \"refs/heads/$2\") ||\n> +                die \"'$2' is not a valid refspec.\"\n> +\n> +\t        rev=$(git rev-parse --verify $2) ||\n> +                die \"'$2' is not a valid refspec.\"\n> +\n\nLikewise.\n\n>  \t\t\"cmd_add_repository\" \"$@\"\n>  \telse\n>  \t    say \"error: parameters were '$@'\"\n"},{"id":"205788","messageId":"7vwqvw8tur.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-5-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 4/8] Fix Synopsis","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:40:44Z","receivedAt":"2013-01-01T21:40:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: \"David A. Greene\" <greened@obbligato.org>\n>\n> Fix the documentation of add to show that a repository can be\n> specified along with a commit.\n>\n> Change \"commit\" to \"refspec\" in the synopsis for add.\n>\n> Suggested by Yann Dirson <dirson@bertin.fr>.\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n>  contrib/subtree/git-subtree.sh  |    3 ++-\n>  contrib/subtree/git-subtree.txt |    3 ++-\n>  2 files changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index b8a807a..ad62dfb 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -8,7 +8,8 @@ if [ $# -eq 0 ]; then\n>      set -- -h\n>  fi\n>  OPTS_SPEC=\"\\\n> -git subtree add   --prefix=<prefix> <commit>\n> +git subtree add   --prefix=<prefix> <refspec>\n\nAgain, this is not <refspec> but <commit>.\n\n> +git subtree add   --prefix=<prefix> <repository> <refspec>\n\nThis is given to \"fetch\" and it seems to acccept any <refspec>, so\nit is probably a good change (I didn't fully follow the codepath,\nthough).\n\n>  git subtree merge --prefix=<prefix> <commit>\n>  git subtree pull  --prefix=<prefix> <repository> <refspec...>\n>  git subtree push  --prefix=<prefix> <repository> <refspec...>\n> diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt\n> index ae420aa..89c2d6e 100644\n> --- a/contrib/subtree/git-subtree.txt\n> +++ b/contrib/subtree/git-subtree.txt\n> @@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees\n>  SYNOPSIS\n>  --------\n>  [verse]\n> -'git subtree' add   -P <prefix> <commit>\n> +'git subtree' add   -P <prefix> <refspec>\n> +'git subtree' add   -P <prefix> <repository> <refspec>\n>  'git subtree' pull  -P <prefix> <repository> <refspec...>\n>  'git subtree' push  -P <prefix> <repository> <refspec...>\n>  'git subtree' merge -P <prefix> <commit>\n"},{"id":"205791","messageId":"7vsj6k8tr8.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-6-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 5/8] Honor DESTDIR","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:42:51Z","receivedAt":"2013-01-01T21:42:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: Adam Tkac <atkac@redhat.com>\n>\n> Teach git-subtree's Makefile to honor DESTDIR.\n>\n> Author:    Adam Tkac <atkac@redhat.com>\n>\n> Signed-off-by:    Adam Tkac <atkac@redhat.com>\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n\nThe contents of the patch looks sensible; the above is questionable\nas all the other messages in this series, though.  Did any of our\ntools cause this failure?  If so I would like to know more about it.\n\n>  contrib/subtree/Makefile |    4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\n> index 05cdd5c..36ae3e4 100644\n> --- a/contrib/subtree/Makefile\n> +++ b/contrib/subtree/Makefile\n> @@ -30,12 +30,12 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)\n>  doc: $(GIT_SUBTREE_DOC)\n>  \n>  install: $(GIT_SUBTREE)\n> -\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(libexecdir)\n> +\t$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(libexecdir)\n>  \n>  install-doc: install-man\n>  \n>  install-man: $(GIT_SUBTREE_DOC)\n> -\t$(INSTALL) -m 644 $^ $(man1dir)\n> +\t$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)\n>  \n>  $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)\n>  \txmlto -m $(MANPAGE_NORMAL_XSL)  man $^\n"},{"id":"205794","messageId":"7vobh88tp3.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-7-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 6/8] Make the Manual Directory if Needed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:44:08Z","receivedAt":"2013-01-01T21:44:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: \"Jesper L. Nielsen\" <lyager@gmail.com>\n>\n> Before install git-subtree documentation, make sure the manpage\n> directory exists.\n>\n> Author:    Jesper L. Nielsen <lyager@gmail.com>\n>\n> Signed-off-by:    Jesper L. Nielsen <lyager@gmail.com>\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n>  contrib/subtree/Makefile |    1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\n> index 36ae3e4..52d6fb9 100644\n> --- a/contrib/subtree/Makefile\n> +++ b/contrib/subtree/Makefile\n> @@ -35,6 +35,7 @@ install: $(GIT_SUBTREE)\n>  install-doc: install-man\n>  \n>  install-man: $(GIT_SUBTREE_DOC)\n> +\tmkdir -p $(man1dir)\n\nWe seem to use \"$(INSTALL) -d -m 755\" for this kind of thing (see\nthe Documentation/Makefile).\n\n>  \t$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)\n>  \n>  $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)\n"},{"id":"205795","messageId":"7vk3rw8to7.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"1357012655-24974-8-git-send-email-greened@obbligato.org","subject":"Re: [PATCH 7/8] Ignore git-subtree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-01T21:44:40Z","receivedAt":"2013-01-01T21:44:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David A. Greene\" <greened@obbligato.org> writes:\n\n> From: Michael Schubert <mschub@elegosoft.com>\n>\n> Add the git-subtree command executable to .gitignore.\n>\n> Author:    Michael Schubert <mschub@elegosoft.com>\n>\n> Signed-off-by:    Michael Schubert <mschub@elegosoft.com>\n>\n> Signed-off-by: David A. Greene <greened@obbligato.org>\n> ---\n\nSeems sensible; I think I have this already in my tree.\n\n>  contrib/subtree/.gitignore |    1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/contrib/subtree/.gitignore b/contrib/subtree/.gitignore\n> index 7e77c9d..91360a3 100644\n> --- a/contrib/subtree/.gitignore\n> +++ b/contrib/subtree/.gitignore\n> @@ -1,4 +1,5 @@\n>  *~\n> +git-subtree\n>  git-subtree.xml\n>  git-subtree.1\n>  mainline\n"},{"id":"205801","messageId":"877gnwh781.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vtxr1bg4g.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:24:46Z","receivedAt":"2013-01-01T22:24:46Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Use %B to format the commit message and body to avoid an extra newline\n>> if a commit only has a subject line.\n>\n> Is this an unconditional improvement, or is it generally an\n> improvement but for some users it may be a regression?  I am\n> guessing it is the former but am just making sure.\n\nThe former.\n\n>> Author:    Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Signed-off-by: David A. Greene <greened@obbligato.org>\n>\n> Please don't do \"Author: \" which does not add anything new.  That is\n> what \"From: \" is for.  Instead it needs to be a sign-off.\n\nOk.  Unfortunately I sent a number of patches like that.  Do you want me\nto re-send them?\n\n> Also, is that a real name, I have to wonder?\n\nNo idea.  Not likely, I'd say.\n\n                        -David\n"},{"id":"205803","messageId":"871ue4h76k.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vpq1pbg1k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:25:39Z","receivedAt":"2013-01-01T22:25:39Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Also, please be careful about the subject line.  I doubt that these\n> 8 patches will stand out as relating to \"contrib/subtree\", when mixed\n> in 200 line output of \"git shortlog --no-merges\".\n\nAh, ok.  I'll be more careful next time.\n\n                          -David\n"},{"id":"205804","messageId":"87wqvwfsfm.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7va9ssa94l.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:29:33Z","receivedAt":"2013-01-01T22:29:33Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> Subject: Re: [PATCH 1/8] Use %B for Split Subject/Body\n>\n> This needs to say \"contrib/subtree\" somewhere (applies to all\n> patches in this series).\n\nOk.  Shall I re-send everything?\n\n>> From: Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Use %B to format the commit message and body to avoid an extra newline\n>> if a commit only has a subject line.\n>>\n>> Author:    Techlive Zheng <techlivezheng@gmail.com>\n>\n> This needs to be a S-o-b instead; is it a real name, by the way?\n\nOk.  No idea about the name but his online presence seems consistent at\nleast.\n\n>> +# Save this hash for testing later.\n>> +\n>> +subdir_hash=`git rev-parse HEAD`\n>> +\n>\n> We prefer $() over ``; much more readable.\n\nAck, of course.  I don't know how I missed that.\n\n>>  # 15\n>>  test_expect_success 'add main6' '\n>>          create main6 &&\n>\n> Why?\n\nIt was in the original testsuite from Avery.  I didn't add or remove any\ntests when I first integrated git-subtree.\n\n>> @@ -235,7 +238,19 @@ test_expect_success 'check split with --branch' '\n>>          check_equal ''\"$(git rev-parse splitbr1)\"'' \"$spl1\"\n>\n> Is quoting screwed up around here (and in many other places in this\n> patch)?  What are these no-op '' doing?\n\nI assumed they are there to get the double-quotes around the command.\nI'll see about removing them.\n\n>> -# 25\n>> +#25\n>\n> Why the lossage of a SP?\n\nI think this got fixed later in the series.\n\n> It may make sense to lose these \"# num\" that will have to be touched\n> every time somebody inserts new test pieces in the middle, as a\n> preparatory step before any of these patches, by the way.  That will\n> reduce noise in the patches for real changes.\n\nYeah, I know, but it makes it really easy to find a test when something\ngoes wrong.\n\n                            -David\n"},{"id":"205805","messageId":"87sj6kfsbz.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7v623ga8vs.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:31:44Z","receivedAt":"2013-01-01T22:31:44Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: James Nylen <jnylen@gmail.com>\n>>\n>> Teach git-subtree about --unannotate.  This option strips a prefix\n>> from a commit message when doing a subtree split.\n>\n> Hrm.  This looks like a workaround for a short-sighted misdesign of\n> the annotate option that only allowed prefixing a fixed string.  I\n> have to wonder if it is better to deprecate --annotate and replace\n> it with a more general \"commit log rewriting\" facility that can\n> cover both use cases?\n\nThat's not a bad idea.  I'd have to think a bit about a sensible design.\nDo you have any ideas, James?\n\nIn the meantime, will you apply the patch or do you prefer a new design?\n\n                      -David\n"},{"id":"205806","messageId":"87obh8fs8e.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7v1ue4a8i0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/8] Better Error Handling for add","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:33:53Z","receivedAt":"2013-01-01T22:33:53Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n>> index 7ceb413..b8a807a 100755\n>> --- a/contrib/subtree/git-subtree.sh\n>> +++ b/contrib/subtree/git-subtree.sh\n>> @@ -509,8 +509,20 @@ cmd_add()\n>>  \tensure_clean\n>>  \t\n>>  \tif [ $# -eq 1 ]; then\n>> +\t        ref=$(git check-ref-format --normalize \"refs/heads/$1\") ||\n>> +                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n>\n> Is a user forbidden from passing a commit that is not at the tip of\n> an existing branch?  In other words, is\n>\n> \t$ subtree add origin/next~4^2\n>\n> forbidden?\n\nGood point.  It probably shouldn't be.  I think rev-parse should be\nenough of a check.\n\n>> +\t        rev=$(git rev-parse --verify $1) ||\n>> +                die \"'$1' is not a valid refspec.  Are you missing a branch?\"\n>> +\n>>  \t\t\"cmd_add_commit\" \"$@\"\n>\n> If you want to make sure you give a comit to add_commit, you can\n> probably say something like this:\n>\n> \tgit rev-parse -q --verify \"$1^{commit}\" >/dev/null ||\n>         die \"'$1' does not refer to a commit\"\n\nWhat does $1^{commit} mean?  I think your suggestion is what I want but\nI don't know what it means yet.  :)\n\n                           -David\n"},{"id":"205807","messageId":"87k3rwfs6e.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vwqvw8tur.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 4/8] Fix Synopsis","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:35:05Z","receivedAt":"2013-01-01T22:35:05Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> -git subtree add   --prefix=<prefix> <commit>\n>> +git subtree add   --prefix=<prefix> <refspec>\n>\n> Again, this is not <refspec> but <commit>.\n\nOk, I need to study the terminology.  :)\n\n>> +git subtree add   --prefix=<prefix> <repository> <refspec>\n>\n> This is given to \"fetch\" and it seems to acccept any <refspec>, so\n> it is probably a good change (I didn't fully follow the codepath,\n> though).\n\nI think you are correct.\n\n                          -David\n"},{"id":"205808","messageId":"87fw2kfs3i.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vsj6k8tr8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 5/8] Honor DESTDIR","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:36:49Z","receivedAt":"2013-01-01T22:36:49Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: Adam Tkac <atkac@redhat.com>\n>>\n>> Teach git-subtree's Makefile to honor DESTDIR.\n>>\n>> Author:    Adam Tkac <atkac@redhat.com>\n>>\n>> Signed-off-by:    Adam Tkac <atkac@redhat.com>\n>>\n>> Signed-off-by: David A. Greene <greened@obbligato.org>\n>> ---\n>\n> The contents of the patch looks sensible; the above is questionable\n> as all the other messages in this series, though.  Did any of our\n> tools cause this failure?  If so I would like to know more about it.\n\nWhat failure are you referring to?  When I used git send-email --author,\nthe Author: line was commented out.  I assumed I was supposed to\nuncomment it.  Guess I was wrong.\n\nI'll re-send the series since you pointed out a number of improvements.\n\n                       -David\n"},{"id":"205809","messageId":"87bod8fs28.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vobh88tp3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 6/8] Make the Manual Directory if Needed","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-01T22:37:35Z","receivedAt":"2013-01-01T22:37:35Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile\n>> index 36ae3e4..52d6fb9 100644\n>> --- a/contrib/subtree/Makefile\n>> +++ b/contrib/subtree/Makefile\n>> @@ -35,6 +35,7 @@ install: $(GIT_SUBTREE)\n>>  install-doc: install-man\n>>  \n>>  install-man: $(GIT_SUBTREE_DOC)\n>> +\tmkdir -p $(man1dir)\n>\n> We seem to use \"$(INSTALL) -d -m 755\" for this kind of thing (see\n> the Documentation/Makefile).\n\nOk, will fix.\n\n                             -Dave\n"},{"id":"205817","messageId":"7vehi477er.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"87wqvwfsfm.fsf@waller.obbligato.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T00:30:52Z","receivedAt":"2013-01-02T00:30:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greened@obbligato.org writes:\n\n> Ack, of course.  I don't know how I missed that.\n>\n>>>  # 15\n>>>  test_expect_success 'add main6' '\n>>>          create main6 &&\n>>\n>> Why?\n>\n> It was in the original testsuite from Avery.  I didn't add or remove any\n> tests when I first integrated git-subtree.\n\nThe question was about the lossage of the blank line, which does not\nseem to be related to what this patch wants to do.\n\n>>> -# 25\n>>> +#25\n>>\n>> Why the lossage of a SP?\n>\n> I think this got fixed later in the series.\n\nThat is not a good excuse to introduce breakages in the first place, no?\n\n>> It may make sense to lose these \"# num\" that will have to be touched\n>> every time somebody inserts new test pieces in the middle, as a\n>> preparatory step before any of these patches, by the way.  That will\n>> reduce noise in the patches for real changes.\n>\n> Yeah, I know, but it makes it really easy to find a test when something\n> goes wrong.\n\nThat is what \"tXXXX-*.sh -i\" is for, isn't it?\n"},{"id":"205818","messageId":"7va9ss77bu.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"87sj6kfsbz.fsf@waller.obbligato.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T00:32:37Z","receivedAt":"2013-01-02T00:32:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greened@obbligato.org writes:\n\n> In the meantime, will you apply the patch or do you prefer a new design?\n\nThe --unannotate option will become a baggage you will have to keep\nworking until the end of time, if we applied it.  I think it is not\ntoo uch a baggage, so it probably is OK.\n"},{"id":"205828","messageId":"7vobh85np6.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"87obh8fs8e.fsf@waller.obbligato.org","subject":"Re: [PATCH 3/8] Better Error Handling for add","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T02:21:57Z","receivedAt":"2013-01-02T02:21:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greened@obbligato.org writes:\n\n>> If you want to make sure you give a comit to add_commit, you can\n>> probably say something like this:\n>>\n>> \tgit rev-parse -q --verify \"$1^{commit}\" >/dev/null ||\n>>         die \"'$1' does not refer to a commit\"\n>\n> What does $1^{commit} mean?\n\n\"$thing^{type}\" tells Git to interpret the $thing as that type (and\nerror out if it can't).\n\nSo v1.0.0^{commit} is a less cryptic way to say v1.0.0^0 (there is\nno need to say \"zeroth parent of a commit is the commit itself?\nYeah, it makes sort of sense\" when you learn it).\n\n\"git cat-file -t junio-gpg-pub^{blob}\" will say \"blob\", but you will\nget a failure from \"git rev-parse v1.0.0^{blob}\" as you can only\ndereference a tag that refers to a commit down to the comit and then\nto its top-level tree, but not to a single blob.\n\nAnd you can ask for the tree object with v1.0.0^{tree}, for example.\n\n        \n"},{"id":"206226","messageId":"CAPYzjrRzXqgYRQZ429iVv-HPA_gatoE+H0ofyebYAEBmYoQ71w@mail.gmail.com","threadId":"32493","inReplyTo":"CAPYzjrTqmzuWoDg+zvLxwB7g6J4J2wbBqpL+UbHKRHcbjA4HrA@mail.gmail.com","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"郑文辉 (Techlive Zheng)","fromEmail":"techlivezheng@gmail.com","sentAt":"2013-01-07T15:00:00Z","receivedAt":"2013-01-07T15:00:00Z","isPatch":true,"sender":{"key":"techlivezheng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/816673?v=4"},"body":" 2013/1/1 Junio C Hamano <gitster@pobox.com>:\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Use %B to format the commit message and body to avoid an extra newline\n>> if a commit only has a subject line.\n>\n> Is this an unconditional improvement, or is it generally an\n> improvement but for some users it may be a regression?  I am\n> guessing it is the former but am just making sure.\n>\n>> Author:    Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Signed-off-by: David A. Greene <greened@obbligato.org>\n>\n> Please don't do \"Author: \" which does not add anything new.  That is\n> what \"From: \" is for.  Instead it needs to be a sign-off.\n>\n> Also, is that a real name, I have to wonder?\n>\nHmm, sorry about the confusing.\n\nI am a Chinese, I coined that first name a couple years ago when I\ndecided to have a unique name across the web. My real name is \"郑文辉\" in\nChinese，translate to English by its pronucation is \"Wenhui\nZheng\"，which means \"Zheng\" is acturally my real last name. The first\nname \"Wenhui\" does not have any meaning in English, so I coined it by\n\"Tech\" + \"Live\", which I interprate it as \"Technological Living\",\nthus, \"Techlive Zheng\" is the name I am currently using online.\n\nHere are some links:\n\n* Let the code talks. https://github.com/techlivezheng\n* I cross the great GFW to use twitter. https://twitter.com/techlivezheng\n* Also search \"Techlive Zheng\" in Google, the result should be unique to me.\n\nSo, no doubt, I am a real person, just with kind of an uncommon name.\n\n>> Thanks.\n"},{"id":"206228","messageId":"CAPYzjrT_8g26y-QrYvbQYoySWskGdn15jCX60rz04wQFQ2ikVw@mail.gmail.com","threadId":"32493","inReplyTo":"7vtxr1bg4g.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"郑文辉 (Techlive Zheng)","fromEmail":"techlivezheng@gmail.com","sentAt":"2013-01-07T15:18:02Z","receivedAt":"2013-01-07T15:18:02Z","isPatch":true,"sender":{"key":"techlivezheng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/816673?v=4"},"body":"2013/1/1 Junio C Hamano <gitster@pobox.com>:\n> \"David A. Greene\" <greened@obbligato.org> writes:\n>\n>> From: Techlive Zheng <techlivezheng@gmail.com>\n>>\n>> Use %B to format the commit message and body to avoid an extra newline\n>> if a commit only has a subject line.\n>\n> Is this an unconditional improvement, or is it generally an\n> improvement but for some users it may be a regression?  I am\n> guessing it is the former but am just making sure.\n\nThis patch will make sure the commits in the result branch by using\n`git-subtree split` stays intact as they were in the original branch.\n\nThis patch will break the current existing branch that splitted before\nthis patch, becuase these branches were splitted with the wrongly\naltered commit messages.\n\nMaybe a fallback option should be added to make sure these branches\ncould still be updated.\n\nThough, this patch defintely should be merged, becuase no one expects\nhis commit message be altered durging the splitting process.\n"},{"id":"206235","messageId":"7v8v85j5o0.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"CAPYzjrT_8g26y-QrYvbQYoySWskGdn15jCX60rz04wQFQ2ikVw@mail.gmail.com","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-07T16:53:35Z","receivedAt":"2013-01-07T16:53:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"郑文辉(Techlive Zheng)\"  <techlivezheng@gmail.com> writes:\n\n> Though, this patch defintely should be merged, becuase no one expects\n> his commit message be altered durging the splitting process.\n\nAre you saying that after double-checking what was posted?  It said\nsomething like this below, which does not look like 'definitely\nshould be' to me.\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 920c664..f2b6d4a 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -296,7 +296,12 @@ copy_commit()\n \t# We're going to set some environment vars here, so\n \t# do it in a subshell to get rid of them safely later\n \tdebug copy_commit \"{$1}\" \"{$2}\" \"{$3}\"\n+\t# Use %B rather than %s%n%n%b to handle the special case of a\n+\t# commit that only has a subject line.  We don't want to\n+\t# introduce a newline after the subject, causing generation of\n+\t# a new hash.\n \tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b' \"$1\" |\n+#\tgit log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' \"$1\" |\n \t(\n \t\tread GIT_AUTHOR_NAME\n \t\tread GIT_AUTHOR_EMAIL\n"},{"id":"206280","messageId":"87d2xglzzc.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7vehi477er.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/8] Use %B for Split Subject/Body","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-08T10:40:23Z","receivedAt":"2013-01-08T10:40:23Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> The question was about the lossage of the blank line, which does not\n> seem to be related to what this patch wants to do.\n\nAh, missed that.\n\n>>>> -# 25\n>>>> +#25\n>>>\n>>> Why the lossage of a SP?\n>>\n>> I think this got fixed later in the series.\n>\n> That is not a good excuse to introduce breakages in the first place, no?\n\nOh, I agree.  I wasn't making excuses.  :)\n\n>>> It may make sense to lose these \"# num\" that will have to be touched\n>>> every time somebody inserts new test pieces in the middle, as a\n>>> preparatory step before any of these patches, by the way.  That will\n>>> reduce noise in the patches for real changes.\n>>\n>> Yeah, I know, but it makes it really easy to find a test when something\n>> goes wrong.\n>\n> That is what \"tXXXX-*.sh -i\" is for, isn't it?\n\nOh, I didn't know about that!\n\n                        -David\n"},{"id":"206281","messageId":"878v84lzve.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"7va9ss77bu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-08T10:42:45Z","receivedAt":"2013-01-08T10:42:45Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> greened@obbligato.org writes:\n>\n>> In the meantime, will you apply the patch or do you prefer a new design?\n>\n> The --unannotate option will become a baggage you will have to keep\n> working until the end of time, if we applied it.  I think it is not\n> too uch a baggage, so it probably is OK.\n\nOk.  I think it's worth applying since people find it useful.  It's not\nvery complicated.\n\n                       -David\n"},{"id":"207172","messageId":"CABVa4NhK3FR-NsTq6Vt6yrgneQmMxF5ANmN6pF8k3fHeOLd0JA@mail.gmail.com","threadId":"32493","inReplyTo":"87sj6kfsbz.fsf@waller.obbligato.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"James Nylen","fromEmail":"jnylen@gmail.com","sentAt":"2013-01-17T21:07:05Z","receivedAt":"2013-01-17T21:07:05Z","isPatch":true,"sender":{"key":"jnylen@gmail.com","avatar":"https://gravatar.com/avatar/96804ac655933f5b6380e992610d6ff9029c6d04db1042d4bec381312ff7ff1b?d=mp&s=160"},"body":"On Tue, Jan 1, 2013 at 5:31 PM,  <greened@obbligato.org> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> \"David A. Greene\" <greened@obbligato.org> writes:\n>>\n>>> From: James Nylen <jnylen@gmail.com>\n>>>\n>>> Teach git-subtree about --unannotate.  This option strips a prefix\n>>> from a commit message when doing a subtree split.\n>>\n>> Hrm.  This looks like a workaround for a short-sighted misdesign of\n>> the annotate option that only allowed prefixing a fixed string.  I\n>> have to wonder if it is better to deprecate --annotate and replace\n>> it with a more general \"commit log rewriting\" facility that can\n>> cover both use cases?\n>\n> That's not a bad idea.  I'd have to think a bit about a sensible design.\n> Do you have any ideas, James?\n\nI just now saw these emails.  I'm having a hard time thinking of any\ngood use case other than:\n\n - add \"fancylib\" as a subtree of \"myprog\"\n - commit to myprog repo: \"fancylib: don't crash as much\"\n - split these commits back out to fancylib's main repo, and remove\nthe \"fancylib: \" prefix\n\nYou could potentially have something like \"Don't crash as much\n(fancylib)\" but that's awkward.  What might you want to do with a\npattern-based rewrite that doesn't involve removing a prefix when\nsplitting commits?\n\nIn fact, I don't see the use of the original --annotate option at all,\nsince it causes more detailed commit messages in the smaller of the\ntwo repositories.\n"},{"id":"207499","messageId":"878v7lfvz7.fsf@waller.obbligato.org","threadId":"32493","inReplyTo":"CABVa4NhK3FR-NsTq6Vt6yrgneQmMxF5ANmN6pF8k3fHeOLd0JA@mail.gmail.com","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"","fromEmail":"greened@obbligato.org","sentAt":"2013-01-22T08:44:12Z","receivedAt":"2013-01-22T08:44:12Z","isPatch":true,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"James Nylen <jnylen@gmail.com> writes:\n\n> I just now saw these emails.  I'm having a hard time thinking of any\n> good use case other than:\n>\n>  - add \"fancylib\" as a subtree of \"myprog\"\n>  - commit to myprog repo: \"fancylib: don't crash as much\"\n>  - split these commits back out to fancylib's main repo, and remove\n> the \"fancylib: \" prefix\n\nThat does seem to me to be the common case, at least.\n\n> You could potentially have something like \"Don't crash as much\n> (fancylib)\" but that's awkward.  What might you want to do with a\n> pattern-based rewrite that doesn't involve removing a prefix when\n> splitting commits?\n\nI'm not really sure.  I've never used --annotate in my own work.\n\n> In fact, I don't see the use of the original --annotate option at all,\n> since it causes more detailed commit messages in the smaller of the\n> two repositories.\n\nI'll have to look back through Avery's logs and see if I can puzzle out\nwhy this was added.  If it's not useful, perhaps we can remove it before\nmigrating to mainline.\n\nJunio, is there a policy for backward-compatability in contrib?  I hope\nthat since that directory is for stuff not yet in mainline, there is\nsome room to massage the user interface.\n\n                            -David\n"},{"id":"207510","messageId":"7vobghb3vz.fsf@alter.siamese.dyndns.org","threadId":"32493","inReplyTo":"878v7lfvz7.fsf@waller.obbligato.org","subject":"Re: [PATCH 2/8] Add --unannotate","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-22T16:04:32Z","receivedAt":"2013-01-22T16:04:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greened@obbligato.org writes:\n\n> Junio, is there a policy for backward-compatability in contrib?  I hope\n> that since that directory is for stuff not yet in mainline, there is\n> some room to massage the user interface.\n\nI do not think there is anything more than \"we wish there were fewer\nsuch end-user facing changes.\"\n\nThe purpose of having anything in contrib/ is to give them a way to\ngain more visibility than they otherwise would as standalone\nprojects on their own. I don't want to control the day-to-day\nquality issues in them.  That is what we have \"guilty parties\" for\ncontrib/ subdirectories for, so that they can decide how mature\ntheir pieces in contrib/ are and what kind of b/c break is\nacceptable ;-)\n\nThanks.\n"}]}