{"thread":{"id":"40277","subject":"[PATCH v1 1/2] t7900-subtree: test the \"space in a subdirectory name\" case","startedAt":"2015-09-04T22:24:09Z","lastAt":"2015-09-07T11:05:54Z","messageCount":5,"participants":["Alexey Shumkin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"269453","messageId":"cover.1441404851.git.Alex.Crezoff@gmail.com","threadId":"40277","inReplyTo":null,"subject":"[PATCH v1 0/2] contrib/subtree: make it respect spaces in a repository path","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2015-09-04T22:24:09Z","receivedAt":"2015-09-04T22:24:09Z","isPatch":true,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Some repositories may have spaces in their paths. Currently `git-subtree`\nraises an error in such cases.\nAlso, `git-subtree` currently does not have tests for its 'push' command.\nFollowing patches are to fix these statements.\n\nAlexey Shumkin (2):\n  t7900-subtree: test the \"space in a subdirectory name\" case\n  contrib/subtree: respect spaces in a repository path\n\n contrib/subtree/git-subtree.sh     |   4 +-\n contrib/subtree/t/t7900-subtree.sh | 194 +++++++++++++++++++++++--------------\n 2 files changed, 124 insertions(+), 74 deletions(-)\n\n-- \n2.4.1-21\n"},{"id":"269452","messageId":"d3e9f4150d2b6f1308a01eb248e5a54bc16e683a.1441404851.git.Alex.Crezoff@gmail.com","threadId":"40277","inReplyTo":"cover.1441404851.git.Alex.Crezoff@gmail.com","subject":"[PATCH v1 1/2] t7900-subtree: test the \"space in a subdirectory name\" case","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2015-09-04T22:24:10Z","receivedAt":"2015-09-04T22:24:10Z","isPatch":true,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"In common case there can be spaces in a subdirectory name. Change tests\naccorgingly to this statement.\n\nAlso, as far as a call to the `rejoin_msg` function (in `cmd_split`)\ndoes not take into account such a case this patch fixes commit message\nwhen `--rejoin` option is set .\n\nBesides, as `fixnl` and `multiline` functions did not take into account\nthe \"new\" tested \"space in a subdirectory name\" case they become unused\nand redundant, so they are removed.\n\nSigned-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>\n---\n contrib/subtree/git-subtree.sh     |   2 +-\n contrib/subtree/t/t7900-subtree.sh | 147 +++++++++++++++++++------------------\n 2 files changed, 76 insertions(+), 73 deletions(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 9f06571..72a20c0 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -648,7 +648,7 @@ cmd_split()\n \t\tdebug \"Merging split branch into HEAD...\"\n \t\tlatest_old=$(cache_get latest_old)\n \t\tgit merge -s ours \\\n-\t\t\t-m \"$(rejoin_msg $dir $latest_old $latest_new)\" \\\n+\t\t\t-m \"$(rejoin_msg \"$dir\" $latest_old $latest_new)\" \\\n \t\t\t$latest_new >&2 || exit $?\n \tfi\n \tif [ -n \"$branch\" ]; then\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 9051982..9979827 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -32,25 +32,6 @@ check_equal()\n \tfi\n }\n \n-fixnl()\n-{\n-\tt=\"\"\n-\twhile read x; do\n-\t\tt=\"$t$x \"\n-\tdone\n-\techo $t\n-}\n-\n-multiline()\n-{\n-\twhile read x; do\n-\t\tset -- $x\n-\t\tfor d in \"$@\"; do\n-\t\t\techo \"$d\"\n-\t\tdone\n-\tdone\n-}\n-\n undo()\n {\n \tgit reset --hard HEAD~\n@@ -62,11 +43,11 @@ last_commit_message()\n }\n \n test_expect_success 'init subproj' '\n-\ttest_create_repo subproj\n+\ttest_create_repo \"sub proj\"\n '\n \n # To the subproject!\n-cd subproj\n+cd ./\"sub proj\"\n \n test_expect_success 'add sub1' '\n \tcreate sub1 &&\n@@ -106,39 +87,39 @@ test_expect_success 'add main4' '\n '\n \n test_expect_success 'fetch subproj history' '\n-\tgit fetch ./subproj sub1 &&\n+\tgit fetch ./\"sub proj\" sub1 &&\n \tgit branch sub1 FETCH_HEAD\n '\n \n test_expect_success 'no subtree exists in main tree' '\n-\ttest_must_fail git subtree merge --prefix=subdir sub1\n+\ttest_must_fail git subtree merge --prefix=\"sub dir\" sub1\n '\n \n test_expect_success 'no pull from non-existant subtree' '\n-\ttest_must_fail git subtree pull --prefix=subdir ./subproj sub1\n+\ttest_must_fail git subtree pull --prefix=\"sub dir\" ./\"sub proj\" sub1\n '\n \n test_expect_success 'check if --message works for add' '\n-\tgit subtree add --prefix=subdir --message=\"Added subproject\" sub1 &&\n+\tgit subtree add --prefix=\"sub dir\" --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-\tgit subtree add -P subdir -m \"Added subproject using git subtree\" sub1 &&\n+\tgit subtree add -P \"sub dir\" -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-\tgit subtree add -P subdir -m \"Added subproject with squash\" --squash sub1 &&\n+\tgit subtree add -P \"sub dir\" -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-\tgit subtree add --prefix=subdir/ FETCH_HEAD &&\n-\tcheck_equal ''\"$(last_commit_message)\"'' \"Add '\"'subdir/'\"' from commit '\"'\"'''\"$(git rev-parse sub1)\"'''\"'\"'\"\n+\tgit subtree add --prefix=\"sub dir\"/ FETCH_HEAD &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Add '\"'sub dir/'\"' from commit '\"'\"'''\"$(git rev-parse sub1)\"'''\"'\"'\"\n '\n \n # this shouldn't actually do anything, since FETCH_HEAD is already a parent\n@@ -147,7 +128,7 @@ test_expect_success 'merge fetched subproj' '\n '\n \n test_expect_success 'add main-sub5' '\n-\tcreate subdir/main-sub5 &&\n+\tcreate \"sub dir/main-sub5\" &&\n \tgit commit -m \"main-sub5\"\n '\n \n@@ -157,29 +138,29 @@ test_expect_success 'add main6' '\n '\n \n test_expect_success 'add main-sub7' '\n-\tcreate subdir/main-sub7 &&\n+\tcreate \"sub dir/main-sub7\" &&\n \tgit commit -m \"main-sub7\"\n '\n \n test_expect_success 'fetch new subproj history' '\n-\tgit fetch ./subproj sub2 &&\n+\tgit fetch ./\"sub proj\" sub2 &&\n \tgit branch sub2 FETCH_HEAD\n '\n \n test_expect_success 'check if --message works for merge' '\n-\tgit subtree merge --prefix=subdir -m \"Merged changes from subproject\" sub2 &&\n+\tgit subtree merge --prefix=\"sub dir\" -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-\tgit subtree merge --prefix subdir -m \"Merged changes from subproject using squash\" --squash sub2 &&\n+\tgit subtree merge --prefix \"sub dir\" -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-\tgit subtree merge --prefix=subdir FETCH_HEAD &&\n+\tgit subtree merge --prefix=\"sub dir\" FETCH_HEAD &&\n \tgit branch pre-split &&\n \tcheck_equal ''\"$(last_commit_message)\"'' \"Merge commit '\"'\"'\"$(git rev-parse sub2)\"'\"'\"' into mainline\" &&\n \tundo\n@@ -208,53 +189,53 @@ test_expect_success 'Check that the <prefix> exists for a split' '\n '\n \n test_expect_success 'check if --message works for split+rejoin' '\n-\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --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-\tspl1=$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin) &&\n+\tspl1=$(git subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin) &&\n \tundo &&\n-\tgit subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --branch splitbr1 &&\n+\tgit subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --onto FETCH_HEAD --branch splitbr1 &&\n \tcheck_equal ''\"$(git rev-parse splitbr1)\"'' \"$spl1\"\n '\n \n test_expect_success 'check hash of split' '\n-\tspl1=$(git subtree split --prefix subdir) &&\n-\tgit subtree split --prefix subdir --branch splitbr1test &&\n+\tspl1=$(git subtree split --prefix \"sub dir\") &&\n+\tgit subtree split --prefix \"sub dir\" --branch splitbr1test &&\n \tcheck_equal ''\"$(git rev-parse splitbr1test)\"'' \"$spl1\" &&\n \tnew_hash=$(git rev-parse splitbr1test~2) &&\n \tcheck_equal ''\"$new_hash\"'' \"$subdir_hash\"\n '\n \n test_expect_success 'check split with --branch for an existing branch' '\n-\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --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+\tgit subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --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-\ttest_must_fail git subtree split --prefix subdir --onto FETCH_HEAD --branch subdir\n+\ttest_must_fail git subtree split --prefix \"sub dir\" --onto FETCH_HEAD --branch subdir\n '\n \n test_expect_success 'check split+rejoin' '\n-\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --onto FETCH_HEAD --message \"Split & rejoin\" --rejoin)\"'' &&\n+\tspl1=''\"$(git subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --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+\tgit subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --onto FETCH_HEAD --rejoin &&\n+\tcheck_equal ''\"$(last_commit_message)\"'' \"Split '\"'\"'sub dir/'\"'\"' into commit '\"'\"'\"$spl1\"'\"'\"'\"\n '\n \n test_expect_success 'add main-sub8' '\n-\tcreate subdir/main-sub8 &&\n+\tcreate \"sub dir/main-sub8\" &&\n \tgit commit -m \"main-sub8\"\n '\n \n # To the subproject!\n-cd ./subproj\n+cd ./\"sub proj\"\n \n test_expect_success 'merge split into subproj' '\n \tgit fetch .. spl1 &&\n@@ -271,22 +252,22 @@ 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 \"sub dir/\" --rejoin)\"'' &&\n \tgit branch split2 \"$split2\"\n '\n \n test_expect_success 'add main-sub10' '\n-\tcreate subdir/main-sub10 &&\n+\tcreate \"sub dir/main-sub10\" &&\n \tgit commit -m \"main-sub10\"\n '\n \n test_expect_success 'split for sub10' '\n-\tspl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix subdir --rejoin)\"'' &&\n+\tspl3=''\"$(git subtree split --annotate='\"'*'\"' --prefix \"sub dir\" --rejoin)\"'' &&\n \tgit branch spl3 \"$spl3\"\n '\n \n # To the subproject!\n-cd ./subproj\n+cd ./\"sub proj\"\n \n test_expect_success 'merge split into subproj' '\n \tgit fetch .. spl3 &&\n@@ -295,42 +276,64 @@ test_expect_success 'merge split into subproj' '\n \tgit branch subproj-merge-spl3\n '\n \n-chkm=\"main4 main6\"\n-chkms=\"main-sub10 main-sub5 main-sub7 main-sub8\"\n-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+chkm=\"main4\n+main6\"\n+chkms=\"main-sub10\n+main-sub5\n+main-sub7\n+main-sub8\"\n+chkms_sub=$(cat <<TXT | sed 's,^,sub dir/,'\n+$chkms\n+TXT\n+)\n+chks=\"sub1\n+sub2\n+sub3\n+sub9\"\n+chks_sub=$(cat <<TXT | sed 's,^,sub dir/,'\n+$chks\n+TXT\n+)\n \n test_expect_success 'make sure exactly the right set of files ends up in the subproj' '\n-\tsubfiles=''\"$(git ls-files | fixnl)\"'' &&\n-\tcheck_equal \"$subfiles\" \"$chkms $chks\"\n+\tsubfiles=\"$(git ls-files)\" &&\n+\tcheck_equal \"$subfiles\" \"$chkms\n+$chks\"\n '\n-\n test_expect_success 'make sure the subproj history *only* contains commits that affect the subdir' '\n-\tallchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | fixnl)\"'' &&\n-\tcheck_equal \"$allchanges\" \"$chkms $chks\"\n+\tallchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | sed \"/^$/d\")\"'' &&\n+\tcheck_equal \"$allchanges\" \"$chkms\n+$chks\"\n '\n \n # Back to mainline\n cd ..\n \n test_expect_success 'pull from subproj' '\n-\tgit fetch ./subproj subproj-merge-spl3 &&\n+\tgit fetch ./\"sub proj\" subproj-merge-spl3 &&\n \tgit branch subproj-merge-spl3 FETCH_HEAD &&\n-\tgit subtree pull --prefix=subdir ./subproj subproj-merge-spl3\n+\tgit subtree pull --prefix=\"sub dir\" ./\"sub proj\" subproj-merge-spl3\n '\n \n test_expect_success 'make sure exactly the right set of files ends up in the mainline' '\n-\tmainfiles=''\"$(git ls-files | fixnl)\"'' &&\n-\tcheck_equal \"$mainfiles\" \"$chkm $chkms_sub $chks_sub\"\n+\tmainfiles=$(git ls-files) &&\n+\tcheck_equal \"$mainfiles\" \"$chkm\n+$chkms_sub\n+$chks_sub\"\n '\n \n test_expect_success 'make sure each filename changed exactly once in the entire history' '\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+\tallchanges=''\"$(git log --name-only --pretty=format:'\"''\"' | sort | sed \"/^$/d\")\"'' &&\n+\tcheck_equal \"$allchanges\" ''\"$(cat <<TXT | sort\n+$chkms\n+$chkm\n+$chks\n+$chkms_sub\n+TXT\n+)\"''\n '\n \n test_expect_success 'make sure the --rejoin commits never make it into subproj' '\n@@ -377,7 +380,7 @@ cd ../main\n test_expect_success 'add sub as subdir in main' '\n \tgit fetch ../sub master &&\n \tgit branch sub2 FETCH_HEAD &&\n-\tgit subtree add --prefix subdir sub2\n+\tgit subtree add --prefix \"sub dir\" sub2\n '\n \n cd ../sub\n@@ -392,16 +395,16 @@ cd ../main\n test_expect_success 'merge from sub' '\n \tgit fetch ../sub master &&\n \tgit branch sub3 FETCH_HEAD &&\n-\tgit subtree merge --prefix subdir sub3\n+\tgit subtree merge --prefix \"sub dir\" sub3\n '\n \n test_expect_success 'add main-sub4' '\n-\tcreate subdir/main-sub4 &&\n+\tcreate \"sub dir/main-sub4\" &&\n \tgit commit -m \"main-sub4\"\n '\n \n test_expect_success 'split for main-sub4 without --onto' '\n-\tgit subtree split --prefix subdir --branch mainsub4\n+\tgit subtree split --prefix \"sub dir\" --branch mainsub4\n '\n \n # at this point, the new commit parent should be sub3 if it is not,\n-- \n2.4.1-21\n"},{"id":"269454","messageId":"4531a80be47397632eb6293707a0ac08ef18f528.1441404851.git.Alex.Crezoff@gmail.com","threadId":"40277","inReplyTo":"cover.1441404851.git.Alex.Crezoff@gmail.com","subject":"[PATCH v1 2/2] contrib/subtree: respect spaces in a repository path","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2015-09-04T22:24:11Z","receivedAt":"2015-09-04T22:24:11Z","isPatch":true,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Remote repository may have spaces in its path, so take it into account.\n\nAlso, as far as there are no tests for the `push` command, add them.\n\nSigned-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>\n---\n contrib/subtree/git-subtree.sh     |  2 +-\n contrib/subtree/t/t7900-subtree.sh | 47 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 48 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 72a20c0..308b777 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -735,7 +735,7 @@ cmd_push()\n \t    refspec=$2\n \t    echo \"git push using: \" $repository $refspec\n \t    localrev=$(git subtree split --prefix=\"$prefix\") || die\n-\t    git push $repository $localrev:refs/heads/$refspec\n+\t    git push \"$repository\" $localrev:refs/heads/$refspec\n \telse\n \t    die \"'$dir' must already exist. Try 'git subtree add'.\"\n \tfi\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex 9979827..dfbe443 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -1,6 +1,7 @@\n #!/bin/sh\n #\n # Copyright (c) 2012 Avery Pennaraum\n+# Copyright (c) 2015 Alexey Shumkin\n #\n test_description='Basic porcelain support for subtrees\n \n@@ -471,4 +472,50 @@ test_expect_success 'verify one file change per commit' '\n \t))\n '\n \n+# test push\n+\n+cd ../..\n+\n+mkdir test-push\n+\n+cd test-push\n+\n+test_expect_success 'init main' '\n+\ttest_create_repo main\n+'\n+\n+test_expect_success 'init sub' '\n+\ttest_create_repo \"sub project\"\n+'\n+\n+cd ./\"sub project\"\n+\n+test_expect_success 'add subproject' '\n+\tcreate \"sub project\" &&\n+\tgit commit -m \"Sub project: 1\" &&\n+\tgit branch sub-branch-1\n+'\n+\n+cd ../main\n+\n+test_expect_success 'make first commit and add subproject' '\n+\tcreate \"main-1\" &&\n+\tgit commit -m \"main: 1\" &&\n+\tgit subtree add \"../sub project\" --prefix \"sub dir\" --message \"Added subproject\" sub-branch-1 &&\n+\tcheck_equal \"$(last_commit_message)\" \"Added subproject\"\n+'\n+\n+test_expect_success 'make second commit to a subproject file and push it into a sub project' '\n+\tcreate \"sub dir/sub1\" &&\n+\tgit commit -m \"Sub project: 2\" &&\n+\tgit subtree push \"../sub project\" --prefix \"sub dir\" sub-branch-1\n+'\n+\n+cd ../\"sub project\"\n+\n+test_expect_success 'Test second commit is pushed' '\n+\tgit checkout sub-branch-1 &&\n+\tcheck_equal \"$(last_commit_message)\" \"Sub project: 2\"\n+'\n+\n test_done\n-- \n2.4.1-21\n"},{"id":"269457","messageId":"xmqqoahheqax.fsf@gitster.mtv.corp.google.com","threadId":"40277","inReplyTo":"cover.1441404851.git.Alex.Crezoff@gmail.com","subject":"Re: [PATCH v1 0/2] contrib/subtree: make it respect spaces in a repository path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-04T23:08:06Z","receivedAt":"2015-09-04T23:08:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexey Shumkin <alex.crezoff@gmail.com> writes:\n\n> Some repositories may have spaces in their paths. Currently `git-subtree`\n> raises an error in such cases.\n> Also, `git-subtree` currently does not have tests for its 'push' command.\n> Following patches are to fix these statements.\n>\n> Alexey Shumkin (2):\n>   t7900-subtree: test the \"space in a subdirectory name\" case\n>   contrib/subtree: respect spaces in a repository path\n\nDoesn't this order break bisection?  It seems that you turn \"subdir\"\nto \"sub dir\" in existing tests, and I understand that the whole\npoint of this series is that such a change will expose that the tool\nis broken, making tests fail.\n\nAlso, if you feel up to it, it might be a good idea to clean t7900\ntest up to the current best practice before doing any other changes\nas a pure preparatory clean-up patch.\n\nNamely, using cd outside a subshell of the tests to move around is a\nbad thing to do, and you are adding more instance of it in this\nseries.  If one test with such a cd to go down fails before it has a\nchance to come back up (or go up and then fail to come back down),\nthe later tests will be left in an unexpected place.\n\n>  contrib/subtree/git-subtree.sh     |   4 +-\n>  contrib/subtree/t/t7900-subtree.sh | 194 +++++++++++++++++++++++--------------\n>  2 files changed, 124 insertions(+), 74 deletions(-)\n\nThanks.\n"},{"id":"269554","messageId":"20150907110554.GA482@dell-note","threadId":"40277","inReplyTo":"xmqqoahheqax.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v1 0/2] contrib/subtree: make it respect spaces in a repository path","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2015-09-07T11:05:54Z","receivedAt":"2015-09-07T11:05:54Z","isPatch":true,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"On Fri, Sep 04, 2015 at 04:08:06PM -0700, Junio C Hamano wrote:\n> Alexey Shumkin <alex.crezoff@gmail.com> writes:\n> \n> > Some repositories may have spaces in their paths. Currently `git-subtree`\n> > raises an error in such cases.\n> > Also, `git-subtree` currently does not have tests for its 'push' command.\n> > Following patches are to fix these statements.\n> >\n> > Alexey Shumkin (2):\n> >   t7900-subtree: test the \"space in a subdirectory name\" case\n> >   contrib/subtree: respect spaces in a repository path\n> \n> Doesn't this order break bisection?  It seems that you turn \"subdir\"\n> to \"sub dir\" in existing tests, and I understand that the whole\n> point of this series is that such a change will expose that the tool\n> is broken, making tests fail.\nIt seems I have to reword commit messages to avoid such an interpretation.\nBecause, the first commit does not break anything. It is to change the\ntests for `git-subtree` \"to show\" that `git-subtree`s already tested\ncommands (almost) work correctly if there are spaces in paths (except\n--rejoin-msg issue).\nAnd the second commit adds missing tests and the fix.\nShould I add/commit the breaking test first and then commit the fix?\n> \n> Also, if you feel up to it, it might be a good idea to clean t7900\n> test up to the current best practice before doing any other changes\n> as a pure preparatory clean-up patch.\n> \n> Namely, using cd outside a subshell of the tests to move around is a\n> bad thing to do, and you are adding more instance of it in this\n> series.  If one test with such a cd to go down fails before it has a\n> chance to come back up (or go up and then fail to come back down),\n> the later tests will be left in an unexpected place.\nI understand this issue with \"cd\" (I've just followed the existing t7900\ntests \"code style\").\n> \n> >  contrib/subtree/git-subtree.sh     |   4 +-\n> >  contrib/subtree/t/t7900-subtree.sh | 194 +++++++++++++++++++++++--------------\n> >  2 files changed, 124 insertions(+), 74 deletions(-)\n> \n> Thanks.\n\n-- \nAlexey Shumkin\nE-mail: Alex.Crezoff@gmail.com\nICQ: 118001447\nJabber (GoogleTalk): Alex.Crezoff@gmail.com\nSkype: crezoff\n"}]}