{"thread":{"id":"39690","subject":"[PATCH 2/3] contrib/subtree: Fix broken &&-chains and revealed test error","startedAt":"2015-06-22T13:53:28Z","lastAt":"2015-06-22T22:42:34Z","messageCount":4,"participants":["Charles Bailey","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"264514","messageId":"1434981210-13036-1-git-send-email-charles@hashpling.org","threadId":"39690","inReplyTo":null,"subject":"[PATCH 1/3] contrib/subtree: Use tabs consitently for indentation in tests","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2015-06-22T13:53:28Z","receivedAt":"2015-06-22T13:53:28Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"From: Charles Bailey <cbailey32@bloomberg.net>\n\nAlthough subtrees tests uses more spaces for indentation than tabs,\nthere are still quite a lot of lines indented with tabs. As tabs conform\nwith Git coding guidelines resolve the inconsistency in favour of tabs.\n\nSigned-off-by: Charles Bailey <cbailey32@bloomberg.net>\n---\n contrib/subtree/t/t7900-subtree.sh | 294 ++++++++++++++++++-------------------\n 1 file changed, 147 insertions(+), 147 deletions(-)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 6309d12..2c5bfc1 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -62,17 +62,17 @@ last_commit_message()\n }\n \n test_expect_success 'init subproj' '\n-        test_create_repo subproj\n+\ttest_create_repo subproj\n '\n \n # To the subproject!\n cd subproj\n \n test_expect_success 'add sub1' '\n-        create sub1 &&\n-        git commit -m \"sub1\" &&\n-        git branch sub1 &&\n-        git branch -m master subproj\n+\tcreate sub1 &&\n+\tgit commit -m \"sub1\" &&\n+\tgit branch sub1 &&\n+\tgit branch -m master subproj\n '\n \n # Save this hash for testing later.\n@@ -80,133 +80,133 @@ test_expect_success 'add sub1' '\n subdir_hash=$(git rev-parse HEAD)\n \n test_expect_success 'add sub2' '\n-        create sub2 &&\n-        git commit -m \"sub2\" &&\n-        git branch sub2\n+\tcreate sub2 &&\n+\tgit commit -m \"sub2\" &&\n+\tgit branch sub2\n '\n \n test_expect_success 'add sub3' '\n-        create sub3 &&\n-        git commit -m \"sub3\" &&\n-        git branch sub3\n+\tcreate sub3 &&\n+\tgit commit -m \"sub3\" &&\n+\tgit branch sub3\n '\n \n # Back to mainline\n cd ..\n \n test_expect_success 'add main4' '\n-        create main4 &&\n-        git commit -m \"main4\" &&\n-        git branch -m master mainline &&\n-        git branch subdir\n+\tcreate main4 &&\n+\tgit commit -m \"main4\" &&\n+\tgit branch -m master mainline &&\n+\tgit branch subdir\n '\n \n test_expect_success 'fetch subproj history' '\n-        git fetch ./subproj sub1 &&\n-        git branch sub1 FETCH_HEAD\n+\tgit fetch ./subproj sub1 &&\n+\tgit branch sub1 FETCH_HEAD\n '\n \n test_expect_success 'no subtree exists in main tree' '\n-        test_must_fail git subtree merge --prefix=subdir sub1\n+\ttest_must_fail git subtree merge --prefix=subdir sub1\n '\n \n test_expect_success 'no pull from non-existant subtree' '\n-        test_must_fail git subtree pull --prefix=subdir ./subproj sub1\n+\ttest_must_fail git subtree pull --prefix=subdir ./subproj sub1\n '\n \n test_expect_success 'check if --message works for add' '\n-        git subtree add --prefix=subdir --message=\"Added subproject\" sub1 &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Added subproject\" &&\n-        undo\n+\tgit subtree add --prefix=subdir --message=\"Added subproject\" sub1 &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Added subproject\" &&\n+\tundo\n '\n \n test_expect_success 'check if --message works as -m and --prefix as -P' '\n-        git subtree add -P subdir -m \"Added subproject using git subtree\" sub1 &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Added subproject using git subtree\" &&\n-        undo\n+\tgit subtree add -P subdir -m \"Added subproject using git subtree\" sub1 &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Added subproject using git subtree\" &&\n+\tundo\n '\n \n test_expect_success 'check if --message works with squash too' '\n-        git subtree add -P subdir -m \"Added subproject with squash\" --squash sub1 &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Added subproject with squash\" &&\n-        undo\n+\tgit subtree add -P subdir -m \"Added subproject with squash\" --squash sub1 &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Added subproject with squash\" &&\n+\tundo\n '\n \n test_expect_success 'add subproj to mainline' '\n-        git subtree add --prefix=subdir/ FETCH_HEAD &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Add '\"'subdir/'\"' from commit '\"'\"'''\"$(git rev-parse sub1)\"'''\"'\"'\"\n+\tgit subtree add --prefix=subdir/ FETCH_HEAD &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Add '\"'subdir/'\"' from commit '\"'\"'''\"$(git rev-parse sub1)\"'''\"'\"'\"\n '\n \n # this shouldn't actually do anything, since FETCH_HEAD is already a parent\n test_expect_success 'merge fetched subproj' '\n-        git merge -m \"merge -s -ours\" -s ours FETCH_HEAD\n+\tgit merge -m \"merge -s -ours\" -s ours FETCH_HEAD\n '\n \n test_expect_success 'add main-sub5' '\n-        create subdir/main-sub5 &&\n-        git commit -m \"main-sub5\"\n+\tcreate subdir/main-sub5 &&\n+\tgit commit -m \"main-sub5\"\n '\n \n test_expect_success 'add main6' '\n-        create main6 &&\n-        git commit -m \"main6 boring\"\n+\tcreate main6 &&\n+\tgit commit -m \"main6 boring\"\n '\n \n test_expect_success 'add main-sub7' '\n-        create subdir/main-sub7 &&\n-        git commit -m \"main-sub7\"\n+\tcreate subdir/main-sub7 &&\n+\tgit commit -m \"main-sub7\"\n '\n \n test_expect_success 'fetch new subproj history' '\n-        git fetch ./subproj sub2 &&\n-        git branch sub2 FETCH_HEAD\n+\tgit fetch ./subproj sub2 &&\n+\tgit branch sub2 FETCH_HEAD\n '\n \n test_expect_success 'check if --message works for merge' '\n-        git subtree merge --prefix=subdir -m \"Merged changes from subproject\" sub2 &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Merged changes from subproject\" &&\n-        undo\n+\tgit subtree merge --prefix=subdir -m \"Merged changes from subproject\" sub2 &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Merged changes from subproject\" &&\n+\tundo\n '\n \n test_expect_success 'check if --message for merge works with squash too' '\n-        git subtree merge --prefix subdir -m \"Merged changes from subproject using squash\" --squash sub2 &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Merged changes from subproject using squash\" &&\n-        undo\n+\tgit subtree merge --prefix subdir -m \"Merged changes from subproject using squash\" --squash sub2 &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Merged changes from subproject using squash\" &&\n+\tundo\n '\n \n test_expect_success 'merge new subproj history into subdir' '\n-        git subtree merge --prefix=subdir FETCH_HEAD &&\n-        git branch pre-split &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Merge commit '\"'\"'\"$(git rev-parse sub2)\"'\"'\"' into mainline\"\n+\tgit subtree merge --prefix=subdir FETCH_HEAD &&\n+\tgit branch pre-split &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Merge commit '\"'\"'\"$(git rev-parse sub2)\"'\"'\"' into mainline\"\n '\n \n test_expect_success 'Check that prefix argument is required for split' '\n-        echo \"You must provide the --prefix option.\" > expected &&\n-        test_must_fail git subtree split > actual 2>&1 &&\n+\techo \"You must provide the --prefix option.\" > expected &&\n+\ttest_must_fail git subtree split > actual 2>&1 &&\n \ttest_debug \"printf '\"'\"'expected: '\"'\"'\" &&\n-        test_debug \"cat expected\" &&\n+\ttest_debug \"cat expected\" &&\n \ttest_debug \"printf '\"'\"'actual: '\"'\"'\" &&\n-        test_debug \"cat actual\" &&\n-        test_cmp expected actual &&\n-        rm -f expected actual\n+\ttest_debug \"cat actual\" &&\n+\ttest_cmp expected actual &&\n+\trm -f expected actual\n '\n \n test_expect_success 'Check that the <prefix> exists for a split' '\n-        echo \"'\"'\"'non-existent-directory'\"'\"'\" does not exist\\; use \"'\"'\"'git subtree add'\"'\"'\" > expected &&\n-        test_must_fail git subtree split --prefix=non-existent-directory > actual 2>&1 &&\n+\techo \"'\"'\"'non-existent-directory'\"'\"'\" does not exist\\; use \"'\"'\"'git subtree add'\"'\"'\" > expected &&\n+\ttest_must_fail git subtree split --prefix=non-existent-directory > actual 2>&1 &&\n \ttest_debug \"printf '\"'\"'expected: '\"'\"'\" &&\n-        test_debug \"cat expected\" &&\n+\ttest_debug \"cat expected\" &&\n \ttest_debug \"printf '\"'\"'actual: '\"'\"'\" &&\n-        test_debug \"cat actual\" &&\n-        test_cmp expected actual\n-#        rm -f expected actual\n+\ttest_debug \"cat actual\" &&\n+\ttest_cmp expected actual\n+#\trm -f expected actual\n '\n \n test_expect_success 'check if --message works for split+rejoin' '\n-        spl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n-        git branch spl1 \"$spl1\" &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Split & rejoin\" &&\n-        undo\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tgit branch spl1 \"$spl1\" &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Split & rejoin\" &&\n+\tundo\n '\n \n test_expect_success 'check split with --branch' '\n@@ -228,69 +228,69 @@ test_expect_success 'check hash of split' '\n '\n \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-        git branch splitbr2 sub1 &&\n-        git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --branch splitbr2 &&\n-        check_equal ''\"$(git rev-parse splitbr2)\"'' \"$spl1\"\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tundo &&\n+\tgit branch splitbr2 sub1 &&\n+\tgit subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --branch splitbr2 &&\n+\tcheck_equal ''\"$(git rev-parse splitbr2)\"'' \"$spl1\"\n '\n \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+\ttest_must_fail git subtree split --prefix subdir --onto FETCH_HEAD --branch subdir\n '\n \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-        git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --rejoin &&\n-        check_equal ''\"$(last_commit_message)\"'' \"Split '\"'\"'subdir/'\"'\"' into commit '\"'\"'\"$spl1\"'\"'\"'\"\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tundo &&\n+\tgit subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --rejoin &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Split '\"'\"'subdir/'\"'\"' into commit '\"'\"'\"$spl1\"'\"'\"'\"\n '\n \n test_expect_success 'add main-sub8' '\n-        create subdir/main-sub8 &&\n-        git commit -m \"main-sub8\"\n+\tcreate subdir/main-sub8 &&\n+\tgit commit -m \"main-sub8\"\n '\n \n # To the subproject!\n cd ./subproj\n \n test_expect_success 'merge split into subproj' '\n-        git fetch .. spl1 &&\n-        git branch spl1 FETCH_HEAD &&\n-        git merge FETCH_HEAD\n+\tgit fetch .. spl1 &&\n+\tgit branch spl1 FETCH_HEAD &&\n+\tgit merge FETCH_HEAD\n '\n \n test_expect_success 'add sub9' '\n-        create sub9 &&\n-        git commit -m \"sub9\"\n+\tcreate sub9 &&\n+\tgit commit -m \"sub9\"\n '\n \n # Back to mainline\n cd ..\n \n test_expect_success 'split for sub8' '\n-        split2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"''\n-        git branch split2 \"$split2\"\n+\tsplit2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"''\n+\tgit branch split2 \"$split2\"\n '\n \n test_expect_success 'add main-sub10' '\n-        create subdir/main-sub10 &&\n-        git commit -m \"main-sub10\"\n+\tcreate subdir/main-sub10 &&\n+\tgit commit -m \"main-sub10\"\n '\n \n test_expect_success 'split for sub10' '\n-        spl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --rejoin)\"'' &&\n-        git branch spl3 \"$spl3\"\n+\tspl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --rejoin)\"'' &&\n+\tgit branch spl3 \"$spl3\"\n '\n \n # To the subproject!\n cd ./subproj\n \n test_expect_success 'merge split into subproj' '\n-        git fetch .. spl3 &&\n-        git branch spl3 FETCH_HEAD &&\n-        git merge FETCH_HEAD &&\n-        git branch subproj-merge-spl3\n+\tgit fetch .. spl3 &&\n+\tgit branch spl3 FETCH_HEAD &&\n+\tgit merge FETCH_HEAD &&\n+\tgit branch subproj-merge-spl3\n '\n \n chkm=\"main4 main6\"\n@@ -300,44 +300,44 @@ chks=\"sub1 sub2 sub3 sub9\"\n chks_sub=$(echo $chks | multiline | sed 's,^,subdir/,' | fixnl)\n \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+\tsubfiles=''\"$(git ls-files | fixnl)\"'' &&\n+\tcheck_equal \"$subfiles\" \"$chkms $chks\"\n '\n \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+\tallchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n+\tcheck_equal \"$allchanges\" \"$chkms $chks\"\n '\n \n # Back to mainline\n cd ..\n \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+\tgit fetch ./subproj subproj-merge-spl3 &&\n+\tgit branch subproj-merge-spl3 FETCH_HEAD &&\n+\tgit subtree pull --prefix=subdir ./subproj subproj-merge-spl3\n '\n \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+\tmainfiles=''\"$(git ls-files | fixnl)\"'' &&\n+\tcheck_equal \"$mainfiles\" \"$chkm $chkms_sub $chks_sub\"\n '\n \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-        # change, since they were *only* changed in the subtree branch.\n-        allchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n-        check_equal \"$allchanges\" ''\"$(echo $chkms $chkm $chks $chkms_sub | multiline | sort | fixnl)\"''\n+\t# main-sub?? and /subdir/main-sub?? both change, because those are the\n+\t# changes that were split into their own history.  And subdir/sub?? never\n+\t# change, since they were *only* changed in the subtree branch.\n+\tallchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n+\tcheck_equal \"$allchanges\" ''\"$(echo $chkms $chkm $chks $chkms_sub | multiline | sort | fixnl)\"''\n '\n \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+\tcheck_equal ''\"$(git log --pretty=format:'\"'%s'\"' HEAD^2 | grep -i split)\"'' \"\"\n '\n \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+\t# They are meaningless to subproj since one side of the merge refers to the mainline\n+\tcheck_equal ''\"$(git log --pretty=format:'\"'%s%n%b'\"' HEAD^2 | grep \"git-subtree.*:\")\"'' \"\"\n '\n \n # prepare second pair of repositories\n@@ -345,27 +345,27 @@ mkdir test2\n cd test2\n \n test_expect_success 'init main' '\n-        test_create_repo main\n+\ttest_create_repo main\n '\n \n cd main\n \n test_expect_success 'add main1' '\n-        create main1 &&\n-        git commit -m \"main1\"\n+\tcreate main1 &&\n+\tgit commit -m \"main1\"\n '\n \n cd ..\n \n test_expect_success 'init sub' '\n-        test_create_repo sub\n+\ttest_create_repo sub\n '\n \n cd sub\n \n test_expect_success 'add sub2' '\n-        create sub2 &&\n-        git commit -m \"sub2\"\n+\tcreate sub2 &&\n+\tgit commit -m \"sub2\"\n '\n \n cd ../main\n@@ -373,33 +373,33 @@ cd ../main\n # check if split can find proper base without --onto\n \n test_expect_success 'add sub as subdir in main' '\n-        git fetch ../sub master &&\n-        git branch sub2 FETCH_HEAD &&\n-        git subtree add --prefix subdir sub2\n+\tgit fetch ../sub master &&\n+\tgit branch sub2 FETCH_HEAD &&\n+\tgit subtree add --prefix subdir sub2\n '\n \n cd ../sub\n \n test_expect_success 'add sub3' '\n-        create sub3 &&\n-        git commit -m \"sub3\"\n+\tcreate sub3 &&\n+\tgit commit -m \"sub3\"\n '\n \n cd ../main\n \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+\tgit fetch ../sub master &&\n+\tgit branch sub3 FETCH_HEAD &&\n+\tgit subtree merge --prefix subdir sub3\n '\n \n test_expect_success 'add main-sub4' '\n-        create subdir/main-sub4 &&\n-        git commit -m \"main-sub4\"\n+\tcreate subdir/main-sub4 &&\n+\tgit commit -m \"main-sub4\"\n '\n \n test_expect_success 'split for main-sub4 without --onto' '\n-        git subtree split --prefix subdir --branch mainsub4\n+\tgit subtree split --prefix subdir --branch mainsub4\n '\n \n # at this point, the new commit parent should be sub3 if it is not,\n@@ -408,21 +408,21 @@ test_expect_success 'split for main-sub4 without --onto' '\n # itself)\n \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+\tcheck_equal ''\"$(git log --pretty=format:%P -1 mainsub4)\"'' ''\"$(git rev-parse sub3)\"''\n '\n \n test_expect_success 'add main-sub5' '\n-        mkdir subdir2 &&\n-        create subdir2/main-sub5 &&\n-        git commit -m \"main-sub5\"\n+\tmkdir subdir2 &&\n+\tcreate subdir2/main-sub5 &&\n+\tgit commit -m \"main-sub5\"\n '\n \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+\t# also test that we still can split out an entirely new subtree\n+\t# if the parent of the first commit in the tree is not empty,\n \t# then the new subtree has accidentally been attached to something\n-        git subtree split --prefix subdir2 --branch mainsub5 &&\n-        check_equal ''\"$(git log --pretty=format:%P -1 mainsub5)\"'' \"\"\n+\tgit subtree split --prefix subdir2 --branch mainsub5 &&\n+\tcheck_equal ''\"$(git log --pretty=format:%P -1 mainsub5)\"'' \"\"\n '\n \n # make sure no patch changes more than one file.  The original set of commits\n@@ -450,20 +450,20 @@ joincommits()\n }\n \n test_expect_success 'verify one file change per commit' '\n-        x= &&\n-        list=''\"$(git log --pretty=format:'\"'commit: %H'\"' | joincommits)\"'' &&\n-#        test_debug \"echo HERE\" &&\n-#        test_debug \"echo ''\"$list\"''\" &&\n-        (git log --pretty=format:'\"'commit: %H'\"' | joincommits |\n-        (       while read commit a b; do\n-\t\t        test_debug \"echo Verifying commit \"''\"$commit\"''\n-\t\t        test_debug \"echo a: \"''\"$a\"''\n-\t\t        test_debug \"echo b: \"''\"$b\"''\n-\t\t        check_equal \"$b\" \"\"\n-\t\t        x=1\n-\t        done\n-\t        check_equal \"$x\" 1\n-        ))\n+\tx= &&\n+\tlist=''\"$(git log --pretty=format:'\"'commit: %H'\"' | joincommits)\"'' &&\n+#\ttest_debug \"echo HERE\" &&\n+#\ttest_debug \"echo ''\"$list\"''\" &&\n+\t(git log --pretty=format:'\"'commit: %H'\"' | joincommits |\n+\t(\twhile read commit a b; do\n+\t\t\ttest_debug \"echo Verifying commit \"''\"$commit\"''\n+\t\t\ttest_debug \"echo a: \"''\"$a\"''\n+\t\t\ttest_debug \"echo b: \"''\"$b\"''\n+\t\t\tcheck_equal \"$b\" \"\"\n+\t\t\tx=1\n+\t\tdone\n+\t\tcheck_equal \"$x\" 1\n+\t))\n '\n \n test_done\n-- \n2.4.0.53.g8440f74\n"},{"id":"264513","messageId":"1434981210-13036-2-git-send-email-charles@hashpling.org","threadId":"39690","inReplyTo":"1434981210-13036-1-git-send-email-charles@hashpling.org","subject":"[PATCH 2/3] contrib/subtree: Fix broken &&-chains and revealed test error","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2015-06-22T13:53:29Z","receivedAt":"2015-06-22T13:53:29Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"From: Charles Bailey <cbailey32@bloomberg.net>\n\nThis fixes two instances where a &&-chain was broken in the subtree\ntests and fixes a test error that was revealed because of this.\n\nMany tests in t7900-subtree.sh make a commit and then use 'undo' to\nreset the state for the next test. In the 'check hash of split' test,\nan 'undo' was being invoked after a 'subtree split' even though the\nparticular invocation of 'subtree split' did not actually make a commit.\nThe subsequent check_equal was failing, but this failure was masked by\nthat broken &&-chain.\n\nRemoving this undo causes the failing check_equal to succeed but breaks\nthe a check_equal later on in the same test.\n\nIt turns out that an earlier test ('check if --message for merge works\nwith squash too') makes a commit but doesn't 'undo' to the state\nexpected by the remaining tests. None of the intervening tests cared\nenough about the state of the test repo to fail and the spurious 'undo'\nin 'check hash of split' restored the expected state for any remaining\ntest that might care.\n\nAdding the missing 'undo' to 'check if --message for merge works\nwith squash too' and removing the spurious one from 'check hash of\nsplit' fixes all tests once the &&-chains are completed.\n\nSigned-off-by: Charles Bailey <cbailey32@bloomberg.net>\n---\n contrib/subtree/t/t7900-subtree.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 2c5bfc1..001c604 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -177,7 +177,8 @@ test_expect_success 'check if --message for merge works with squash too' '\n test_expect_success 'merge new subproj history into subdir' '\n \tgit subtree merge --prefix=subdir FETCH_HEAD &&\n \tgit branch pre-split &&\n-\tcheck_equal ''\"$(last_commit_message)\"'' \"Merge commit '\"'\"'\"$(git rev-parse sub2)\"'\"'\"' into mainline\"\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Merge commit '\"'\"'\"$(git rev-parse sub2)\"'\"'\"' into mainline\" &&\n+\tundo\n '\n \n test_expect_success 'Check that prefix argument is required for split' '\n@@ -218,9 +219,8 @@ test_expect_success 'check split with --branch' '\n \n test_expect_success 'check hash of split' '\n \tspl1=$(git subtree split --prefix subdir) &&\n-\tundo &&\n \tgit subtree split --prefix subdir --branch splitbr1test &&\n-\tcheck_equal ''\"$(git rev-parse splitbr1test)\"'' \"$spl1\"\n+\tcheck_equal ''\"$(git rev-parse splitbr1test)\"'' \"$spl1\" &&\n \tgit checkout splitbr1test &&\n \tnew_hash=$(git rev-parse HEAD~2) &&\n \tgit checkout mainline &&\n@@ -269,7 +269,7 @@ test_expect_success 'add sub9' '\n cd ..\n \n test_expect_success 'split for sub8' '\n-\tsplit2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"''\n+\tsplit2=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir/ --rejoin)\"'' &&\n \tgit branch split2 \"$split2\"\n '\n \n-- \n2.4.0.53.g8440f74\n"},{"id":"264515","messageId":"1434981210-13036-3-git-send-email-charles@hashpling.org","threadId":"39690","inReplyTo":"1434981210-13036-1-git-send-email-charles@hashpling.org","subject":"[PATCH 3/3] contrib/subtree: Small tidy-up to test","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2015-06-22T13:53:30Z","receivedAt":"2015-06-22T13:53:30Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"From: Charles Bailey <cbailey32@bloomberg.net>\n\nThere's no need to switch branches to parse another branch's ancestry.\n\nSigned-off-by: Charles Bailey <cbailey32@bloomberg.net>\n---\n contrib/subtree/t/t7900-subtree.sh | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 001c604..bd3df97 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -221,9 +221,7 @@ test_expect_success 'check hash of split' '\n \tspl1=$(git subtree split --prefix subdir) &&\n \tgit subtree split --prefix subdir --branch splitbr1test &&\n \tcheck_equal ''\"$(git rev-parse splitbr1test)\"'' \"$spl1\" &&\n-\tgit checkout splitbr1test &&\n-\tnew_hash=$(git rev-parse HEAD~2) &&\n-\tgit checkout mainline &&\n+\tnew_hash=$(git rev-parse splitbr1test~2) &&\n \tcheck_equal ''\"$new_hash\"'' \"$subdir_hash\"\n '\n \n-- \n2.4.0.53.g8440f74\n"},{"id":"264605","messageId":"CAPig+cQ6o9r6_d5q_os9T=WarKoChosTO7Xm0x=KWoHV87yq7A@mail.gmail.com","threadId":"39690","inReplyTo":"1434981210-13036-1-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 1/3] contrib/subtree: Use tabs consitently for indentation in tests","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-06-22T22:42:34Z","receivedAt":"2015-06-22T22:42:34Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Jun 22, 2015 at 9:53 AM, Charles Bailey <charles@hashpling.org> wrote:\n> contrib/subtree: Use tabs consitently for indentation in tests\n\ns/consitently/consistently/\n\n> Although subtrees tests uses more spaces for indentation than tabs,\n> there are still quite a lot of lines indented with tabs. As tabs conform\n> with Git coding guidelines resolve the inconsistency in favour of tabs.\n>\n> Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>\n"}]}