{"thread":{"id":"34249","subject":"[PATCH v2 00/14] Classify {branches,remotes}-file as fringe features","startedAt":"2013-06-22T07:58:07Z","lastAt":"2013-06-25T10:20:30Z","messageCount":25,"participants":["Ramkumar Ramachandra","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":14},"messages":[{"id":"221658","messageId":"1371887901-5659-1-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":null,"subject":"[PATCH v2 00/14] Classify {branches,remotes}-file as fringe features","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:07Z","receivedAt":"2013-06-22T07:58:07Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nSince I didn't explain the series properly last time: this series\nreduces the burden of the branches-file/remotes-file cruft.  It does\nnot argue for deprecation, because it is still useful to some people\nand harms nobody.  It removes dead code, tests the feature properly,\nand doesn't mention it in obscure places.\n\nIn this iteration, [1/14] does a file-wide style cleanup (wasn't as\npainful as I thought).  Also, one s/git config/test_config/ patch has\nbeen dropped because it adds no value.  This time, I actually ran all\nthe tests to make sure that I made no silly mistakes (there were quite\na few last time).\n\nThanks to Junio and Eric Sunshine for reviews.\n\nRamkumar Ramachandra (14):\n  t/t5505-remote: modernize style\n  t/t5505-remote: test push-refspec in branches-file\n  t/t5505-remote: use test_path_is_missing\n  t/t5505-remote: remove dependency on $origin_url\n  remote: remove dead code in read_branches_file()\n  t/t5505-remote: test url-with-# in branches-file\n  t/t5516-fetch-push: don't use branches-file\n  ls-remote doc: fix example invocation on git.git\n  ls-remote doc: rewrite <repository> paragraph\n  ls-remote doc: don't encourage use of branches-file\n  t/t5505-remote: test multiple push/pull in remotes-file\n  t/t5510-fetch: don't use remotes-file\n  t/t5515-fetch-merge-logic: don't use {branches,remotes}-file\n  remote: add comment about read_{branches,remotes}_file\n\n Documentation/git-ls-remote.txt |  11 +-\n remote.c                        |  34 +-\n t/t5505-remote.sh               | 852 ++++++++++++++++++++++------------------\n t/t5510-fetch.sh                |   9 +-\n t/t5515-fetch-merge-logic.sh    |  28 +-\n t/t5516-fetch-push.sh           |  16 +-\n 6 files changed, 516 insertions(+), 434 deletions(-)\n\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221659","messageId":"1371887901-5659-2-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 01/14] t/t5505-remote: modernize style","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:08Z","receivedAt":"2013-06-22T07:58:08Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Modernize the style of all tests throughout the file:\n- Remove spurious blank lines.\n- Indent the test body.\n- Make sure that all lines end with &&, to make it easier to spot breaks\n  in the chain.\n- When executing something in a subshell, put the parenthesis on\n  separate lines and indent the body.  Also make sure that the first\n  statement in the subshell is a 'cd'.\n- When redirecting output, replace the > output forms with >output.\n- Use the <<-\\EOF and <<-EOF forms of heredoc, not <<EOF.  Also, don't\n  de-indent the heredoc body.\n- When creating an empty file, use : >output form over >output for\n  clarity.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 813 +++++++++++++++++++++++++++++-------------------------\n 1 file changed, 440 insertions(+), 373 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex dd10ff0..f679ded 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -42,107 +42,104 @@ check_tracking_branch () {\n }\n \n test_expect_success setup '\n-\n \tsetup_repository one &&\n \tsetup_repository two &&\n \t(\n-\t\tcd two && git branch another\n+\t\tcd two &&\n+\t\tgit branch another\n \t) &&\n \tgit clone one test\n-\n '\n \n test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '\n-(\n-\tcd test &&\n-\ttokens_match origin \"$(git remote)\" &&\n-\tcheck_remote_track origin master side &&\n-\tcheck_tracking_branch origin HEAD master side\n-)\n+\t(\n+\t\tcd test &&\n+\t\ttokens_match origin \"$(git remote)\" &&\n+\t\tcheck_remote_track origin master side &&\n+\t\tcheck_tracking_branch origin HEAD master side\n+\t)\n '\n \n test_expect_success 'add another remote' '\n-(\n-\tcd test &&\n-\tgit remote add -f second ../two &&\n-\ttokens_match \"origin second\" \"$(git remote)\" &&\n-\tcheck_tracking_branch second master side another &&\n-\tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n-\tsed -e \"/^refs\\/remotes\\/origin\\//d\" \\\n-\t    -e \"/^refs\\/remotes\\/second\\//d\" >actual &&\n-\t>expect &&\n-\ttest_cmp expect actual\n-)\n+\t(\n+\t\tcd test &&\n+\t\tgit remote add -f second ../two &&\n+\t\ttokens_match \"origin second\" \"$(git remote)\" &&\n+\t\tcheck_tracking_branch second master side another &&\n+\t\tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n+\t\tsed -e \"/^refs\\/remotes\\/origin\\//d\" \\\n+\t\t    -e \"/^refs\\/remotes\\/second\\//d\" >actual &&\n+\t\t>expect &&\n+\t\ttest_cmp expect actual\n+\t)\n '\n \n test_expect_success C_LOCALE_OUTPUT 'check remote tracking' '\n-(\n-\tcd test &&\n-\tcheck_remote_track origin master side &&\n-\tcheck_remote_track second master side another\n-)\n+\t(\n+\t\tcd test &&\n+\t\tcheck_remote_track origin master side &&\n+\t\tcheck_remote_track second master side another\n+\t)\n '\n \n test_expect_success 'remote forces tracking branches' '\n-(\n-\tcd test &&\n-\tcase `git config remote.second.fetch` in\n-\t+*) true ;;\n-\t *) false ;;\n-\tesac\n-)\n+\t(\n+\t\tcd test &&\n+\t\tcase `git config remote.second.fetch` in\n+\t\t+*) true ;;\n+\t\t *) false ;;\n+\t\tesac\n+\t)\n '\n \n test_expect_success 'remove remote' '\n-(\n-\tcd test &&\n-\tgit symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&\n-\tgit remote rm second\n-)\n+\t(\n+\t\tcd test &&\n+\t\tgit symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&\n+\t\tgit remote rm second\n+\t)\n '\n \n test_expect_success C_LOCALE_OUTPUT 'remove remote' '\n-(\n-\tcd test &&\n-\ttokens_match origin \"$(git remote)\" &&\n-\tcheck_remote_track origin master side &&\n-\tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n-\tsed -e \"/^refs\\/remotes\\/origin\\//d\" >actual &&\n-\t>expect &&\n-\ttest_cmp expect actual\n-)\n+\t(\n+\t\tcd test &&\n+\t\ttokens_match origin \"$(git remote)\" &&\n+\t\tcheck_remote_track origin master side &&\n+\t\tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n+\t\tsed -e \"/^refs\\/remotes\\/origin\\//d\" >actual &&\n+\t\t: >expect &&\n+\t\ttest_cmp expect actual\n+\t)\n '\n \n test_expect_success 'remove remote protects local branches' '\n-(\n-\tcd test &&\n-\t{ cat >expect1 <<EOF\n-Note: A branch outside the refs/remotes/ hierarchy was not removed;\n-to delete it, use:\n-  git branch -d master\n-EOF\n-\t} &&\n-\t{ cat >expect2 <<EOF\n-Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n-to delete them, use:\n-  git branch -d foobranch\n-  git branch -d master\n-EOF\n-\t} &&\n-\tgit tag footag &&\n-\tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n-\tgit remote remove oops 2>actual1 &&\n-\tgit branch foobranch &&\n-\tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n-\tgit remote rm oops 2>actual2 &&\n-\tgit branch -d foobranch &&\n-\tgit tag -d footag &&\n-\ttest_i18ncmp expect1 actual1 &&\n-\ttest_i18ncmp expect2 actual2\n-)\n-'\n-\n-cat > test/expect << EOF\n+\t(\n+\t\tcd test &&\n+\t\tcat >expect1 <<-\\EOF &&\n+\t\tNote: A branch outside the refs/remotes/ hierarchy was not removed;\n+\t\tto delete it, use:\n+\t\t  git branch -d master\n+\t\tEOF\n+\t\tcat >expect2 <<-\\EOF &&\n+\t\tNote: Some branches outside the refs/remotes/ hierarchy were not removed;\n+\t\tto delete them, use:\n+\t\t  git branch -d foobranch\n+\t\t  git branch -d master\n+\t\tEOF\n+\t\tgit tag footag &&\n+\t\tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n+\t\tgit remote remove oops 2>actual1 &&\n+\t\tgit branch foobranch &&\n+\t\tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n+\t\tgit remote rm oops 2>actual2 &&\n+\t\tgit branch -d foobranch &&\n+\t\tgit tag -d footag &&\n+\t\ttest_i18ncmp expect1 actual1 &&\n+\t\ttest_i18ncmp expect2 actual2\n+\t)\n+'\n+\n+cat >test/expect <<-EOF\n * remote origin\n   Fetch URL: $(pwd)/one\n   Push  URL: $(pwd)/one\n@@ -172,36 +169,40 @@ cat > test/expect << EOF\n EOF\n \n test_expect_success 'show' '\n-\t(cd test &&\n-\t git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&\n-\t git fetch &&\n-\t git checkout -b ahead origin/master &&\n-\t echo 1 >> file &&\n-\t test_tick &&\n-\t git commit -m update file &&\n-\t git checkout master &&\n-\t git branch --track octopus origin/master &&\n-\t git branch --track rebase origin/master &&\n-\t git branch -d -r origin/master &&\n-\t git config --add remote.two.url ../two &&\n-\t git config --add remote.two.pushurl ../three &&\n-\t git config branch.rebase.rebase true &&\n-\t git config branch.octopus.merge \"topic-a topic-b topic-c\" &&\n-\t (cd ../one &&\n-\t  echo 1 > file &&\n-\t  test_tick &&\n-\t  git commit -m update file) &&\n-\t git config --add remote.origin.push : &&\n-\t git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&\n-\t git config --add remote.origin.push +refs/tags/lastbackup &&\n-\t git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&\n-\t git config --add remote.two.push refs/heads/master:refs/heads/another &&\n-\t git remote show origin two > output &&\n-\t git branch -d rebase octopus &&\n-\t test_i18ncmp expect output)\n-'\n-\n-cat > test/expect << EOF\n+\t(\n+\t\tcd test &&\n+\t\tgit config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&\n+\t\tgit fetch &&\n+\t\tgit checkout -b ahead origin/master &&\n+\t\techo 1 >>file &&\n+\t\ttest_tick &&\n+\t\tgit commit -m update file &&\n+\t\tgit checkout master &&\n+\t\tgit branch --track octopus origin/master &&\n+\t\tgit branch --track rebase origin/master &&\n+\t\tgit branch -d -r origin/master &&\n+\t\tgit config --add remote.two.url ../two &&\n+\t\tgit config --add remote.two.pushurl ../three &&\n+\t\tgit config branch.rebase.rebase true &&\n+\t\tgit config branch.octopus.merge \"topic-a topic-b topic-c\" &&\n+\t\t(\n+\t\t\tcd ../one &&\n+\t\t\techo 1 >file &&\n+\t\t\ttest_tick &&\n+\t\t\tgit commit -m update file\n+\t\t) &&\n+\t\tgit config --add remote.origin.push : &&\n+\t\tgit config --add remote.origin.push refs/heads/master:refs/heads/upstream &&\n+\t\tgit config --add remote.origin.push +refs/tags/lastbackup &&\n+\t\tgit config --add remote.two.push +refs/heads/ahead:refs/heads/master &&\n+\t\tgit config --add remote.two.push refs/heads/master:refs/heads/another &&\n+\t\tgit remote show origin two >output &&\n+\t\tgit branch -d rebase octopus &&\n+\t\ttest_i18ncmp expect output\n+\t)\n+'\n+\n+cat >test/expect <<-EOF\n * remote origin\n   Fetch URL: $(pwd)/one\n   Push  URL: $(pwd)/one\n@@ -219,152 +220,187 @@ cat > test/expect << EOF\n EOF\n \n test_expect_success 'show -n' '\n-\t(mv one one.unreachable &&\n-\t cd test &&\n-\t git remote show -n origin > output &&\n-\t mv ../one.unreachable ../one &&\n-\t test_i18ncmp expect output)\n+\tmv one one.unreachable &&\n+\t(\n+\t\tcd test &&\n+\t\tgit remote show -n origin >output &&\n+\t\tmv ../one.unreachable ../one &&\n+\t\ttest_i18ncmp expect output\n+\t)\n '\n \n test_expect_success 'prune' '\n-\t(cd one &&\n-\t git branch -m side side2) &&\n-\t(cd test &&\n-\t git fetch origin &&\n-\t git remote prune origin &&\n-\t git rev-parse refs/remotes/origin/side2 &&\n-\t test_must_fail git rev-parse refs/remotes/origin/side)\n+\t(\n+\t\tcd one &&\n+\t\tgit branch -m side side2\n+\t) &&\n+\t(\n+\t\tcd test &&\n+\t\tgit fetch origin &&\n+\t\tgit remote prune origin &&\n+\t\tgit rev-parse refs/remotes/origin/side2 &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/side\n+\t)\n '\n \n test_expect_success 'set-head --delete' '\n-\t(cd test &&\n-\t git symbolic-ref refs/remotes/origin/HEAD &&\n-\t git remote set-head --delete origin &&\n-\t test_must_fail git symbolic-ref refs/remotes/origin/HEAD)\n+\t(\n+\t\tcd test &&\n+\t\tgit symbolic-ref refs/remotes/origin/HEAD &&\n+\t\tgit remote set-head --delete origin &&\n+\t\ttest_must_fail git symbolic-ref refs/remotes/origin/HEAD\n+\t)\n '\n \n test_expect_success 'set-head --auto' '\n-\t(cd test &&\n-\t git remote set-head --auto origin &&\n-\t echo refs/remotes/origin/master >expect &&\n-\t git symbolic-ref refs/remotes/origin/HEAD >output &&\n-\t test_cmp expect output\n+\t(\n+\t\tcd test &&\n+\t\tgit remote set-head --auto origin &&\n+\t\techo refs/remotes/origin/master >expect &&\n+\t\tgit symbolic-ref refs/remotes/origin/HEAD >output &&\n+\t\ttest_cmp expect output\n \t)\n '\n \n-cat >test/expect <<EOF\n+cat >test/expect <<-\\EOF\n error: Multiple remote HEAD branches. Please choose one explicitly with:\n   git remote set-head two another\n   git remote set-head two master\n EOF\n \n test_expect_success 'set-head --auto fails w/multiple HEADs' '\n-\t(cd test &&\n-\t test_must_fail git remote set-head --auto two >output 2>&1 &&\n-\ttest_i18ncmp expect output)\n+\t(\n+\t\tcd test &&\n+\t\ttest_must_fail git remote set-head --auto two >output 2>&1 &&\n+\t\ttest_i18ncmp expect output\n+\t)\n '\n \n-cat >test/expect <<EOF\n+cat >test/expect <<-\\EOF\n refs/remotes/origin/side2\n EOF\n \n test_expect_success 'set-head explicit' '\n-\t(cd test &&\n-\t git remote set-head origin side2 &&\n-\t git symbolic-ref refs/remotes/origin/HEAD >output &&\n-\t git remote set-head origin master &&\n-\t test_cmp expect output)\n+\t(\n+\t\tcd test &&\n+\t\tgit remote set-head origin side2 &&\n+\t\tgit symbolic-ref refs/remotes/origin/HEAD >output &&\n+\t\tgit remote set-head origin master &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n-cat > test/expect << EOF\n+cat >test/expect <<-EOF\n Pruning origin\n URL: $(pwd)/one\n  * [would prune] origin/side2\n EOF\n \n test_expect_success 'prune --dry-run' '\n-\t(cd one &&\n-\t git branch -m side2 side) &&\n-\t(cd test &&\n-\t git remote prune --dry-run origin > output &&\n-\t git rev-parse refs/remotes/origin/side2 &&\n-\t test_must_fail git rev-parse refs/remotes/origin/side &&\n-\t(cd ../one &&\n-\t git branch -m side side2) &&\n-\t test_i18ncmp expect output)\n+\t(\n+\t\tcd one &&\n+\t\tgit branch -m side2 side) &&\n+\t(\n+\t\tcd test &&\n+\t\tgit remote prune --dry-run origin >output &&\n+\t\tgit rev-parse refs/remotes/origin/side2 &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/side &&\n+\t(\n+\t\tcd ../one &&\n+\t\tgit branch -m side side2) &&\n+\t\ttest_i18ncmp expect output\n+\t)\n '\n \n test_expect_success 'add --mirror && prune' '\n-\t(mkdir mirror &&\n-\t cd mirror &&\n-\t git init --bare &&\n-\t git remote add --mirror -f origin ../one) &&\n-\t(cd one &&\n-\t git branch -m side2 side) &&\n-\t(cd mirror &&\n-\t git rev-parse --verify refs/heads/side2 &&\n-\t test_must_fail git rev-parse --verify refs/heads/side &&\n-\t git fetch origin &&\n-\t git remote prune origin &&\n-\t test_must_fail git rev-parse --verify refs/heads/side2 &&\n-\t git rev-parse --verify refs/heads/side)\n+\tmkdir mirror &&\n+\t(\n+\t\tcd mirror &&\n+\t\tgit init --bare &&\n+\t\tgit remote add --mirror -f origin ../one\n+\t) &&\n+\t(\n+\t\tcd one &&\n+\t\tgit branch -m side2 side\n+\t) &&\n+\t(\n+\t\tcd mirror &&\n+\t\tgit rev-parse --verify refs/heads/side2 &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/side &&\n+\t\tgit fetch origin &&\n+\t\tgit remote prune origin &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/side2 &&\n+\t\tgit rev-parse --verify refs/heads/side\n+\t)\n '\n \n test_expect_success 'add --mirror=fetch' '\n \tmkdir mirror-fetch &&\n \tgit init mirror-fetch/parent &&\n-\t(cd mirror-fetch/parent &&\n-\t test_commit one) &&\n+\t(\n+\t\tcd mirror-fetch/parent &&\n+\t\ttest_commit one\n+\t) &&\n \tgit init --bare mirror-fetch/child &&\n-\t(cd mirror-fetch/child &&\n-\t git remote add --mirror=fetch -f parent ../parent)\n+\t(\n+\t\tcd mirror-fetch/child &&\n+\t\tgit remote add --mirror=fetch -f parent ../parent\n+\t)\n '\n \n test_expect_success 'fetch mirrors act as mirrors during fetch' '\n-\t(cd mirror-fetch/parent &&\n-\t git branch new &&\n-\t git branch -m master renamed\n+\t(\n+\t\tcd mirror-fetch/parent &&\n+\t\tgit branch new &&\n+\t\tgit branch -m master renamed\n \t) &&\n-\t(cd mirror-fetch/child &&\n-\t git fetch parent &&\n-\t git rev-parse --verify refs/heads/new &&\n-\t git rev-parse --verify refs/heads/renamed\n+\t(\n+\t\tcd mirror-fetch/child &&\n+\t\tgit fetch parent &&\n+\t\tgit rev-parse --verify refs/heads/new &&\n+\t\tgit rev-parse --verify refs/heads/renamed\n \t)\n '\n \n test_expect_success 'fetch mirrors can prune' '\n-\t(cd mirror-fetch/child &&\n-\t git remote prune parent &&\n-\t test_must_fail git rev-parse --verify refs/heads/master\n+\t(\n+\t\tcd mirror-fetch/child &&\n+\t\tgit remote prune parent &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/master\n \t)\n '\n \n test_expect_success 'fetch mirrors do not act as mirrors during push' '\n-\t(cd mirror-fetch/parent &&\n-\t git checkout HEAD^0\n+\t(\n+\t\tcd mirror-fetch/parent &&\n+\t\tgit checkout HEAD^0\n \t) &&\n-\t(cd mirror-fetch/child &&\n-\t git branch -m renamed renamed2 &&\n-\t git push parent :\n+\t(\n+\t\tcd mirror-fetch/child &&\n+\t\tgit branch -m renamed renamed2 &&\n+\t\tgit push parent :\n \t) &&\n-\t(cd mirror-fetch/parent &&\n-\t git rev-parse --verify renamed &&\n-\t test_must_fail git rev-parse --verify refs/heads/renamed2\n+\t(\n+\t\tcd mirror-fetch/parent &&\n+\t\tgit rev-parse --verify renamed &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/renamed2\n \t)\n '\n \n test_expect_success 'add fetch mirror with specific branches' '\n \tgit init --bare mirror-fetch/track &&\n-\t(cd mirror-fetch/track &&\n-\t git remote add --mirror=fetch -t heads/new parent ../parent\n+\t(\n+\t\tcd mirror-fetch/track &&\n+\t\tgit remote add --mirror=fetch -t heads/new parent ../parent\n \t)\n '\n \n test_expect_success 'fetch mirror respects specific branches' '\n-\t(cd mirror-fetch/track &&\n-\t git fetch parent &&\n-\t git rev-parse --verify refs/heads/new &&\n-\t test_must_fail git rev-parse --verify refs/heads/renamed\n+\t(\n+\t\tcd mirror-fetch/track &&\n+\t\tgit fetch parent &&\n+\t\tgit rev-parse --verify refs/heads/new &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/renamed\n \t)\n '\n \n@@ -372,60 +408,72 @@ test_expect_success 'add --mirror=push' '\n \tmkdir mirror-push &&\n \tgit init --bare mirror-push/public &&\n \tgit init mirror-push/private &&\n-\t(cd mirror-push/private &&\n-\t test_commit one &&\n-\t git remote add --mirror=push public ../public\n+\t(\n+\t\tcd mirror-push/private &&\n+\t\ttest_commit one &&\n+\t\tgit remote add --mirror=push public ../public\n \t)\n '\n \n test_expect_success 'push mirrors act as mirrors during push' '\n-\t(cd mirror-push/private &&\n-\t git branch new &&\n-\t git branch -m master renamed &&\n-\t git push public\n+\t(\n+\t\tcd mirror-push/private &&\n+\t\tgit branch new &&\n+\t\tgit branch -m master renamed &&\n+\t\tgit push public\n \t) &&\n-\t(cd mirror-push/private &&\n-\t git rev-parse --verify refs/heads/new &&\n-\t git rev-parse --verify refs/heads/renamed &&\n-\t test_must_fail git rev-parse --verify refs/heads/master\n+\t(\n+\t\tcd mirror-push/private &&\n+\t\tgit rev-parse --verify refs/heads/new &&\n+\t\tgit rev-parse --verify refs/heads/renamed &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/master\n \t)\n '\n \n test_expect_success 'push mirrors do not act as mirrors during fetch' '\n-\t(cd mirror-push/public &&\n-\t git branch -m renamed renamed2 &&\n-\t git symbolic-ref HEAD refs/heads/renamed2\n+\t(\n+\t\tcd mirror-push/public &&\n+\t\tgit branch -m renamed renamed2 &&\n+\t\tgit symbolic-ref HEAD refs/heads/renamed2\n \t) &&\n-\t(cd mirror-push/private &&\n-\t git fetch public &&\n-\t git rev-parse --verify refs/heads/renamed &&\n-\t test_must_fail git rev-parse --verify refs/heads/renamed2\n+\t(\n+\t\tcd mirror-push/private &&\n+\t\tgit fetch public &&\n+\t\tgit rev-parse --verify refs/heads/renamed &&\n+\t\ttest_must_fail git rev-parse --verify refs/heads/renamed2\n \t)\n '\n \n test_expect_success 'push mirrors do not allow you to specify refs' '\n \tgit init mirror-push/track &&\n-\t(cd mirror-push/track &&\n-\t test_must_fail git remote add --mirror=push -t new public ../public\n+\t(\n+\t\tcd mirror-push/track &&\n+\t\ttest_must_fail git remote add --mirror=push -t new public ../public\n \t)\n '\n \n test_expect_success 'add alt && prune' '\n-\t(mkdir alttst &&\n-\t cd alttst &&\n-\t git init &&\n-\t git remote add -f origin ../one &&\n-\t git config remote.alt.url ../one &&\n-\t git config remote.alt.fetch \"+refs/heads/*:refs/remotes/origin/*\") &&\n-\t(cd one &&\n-\t git branch -m side side2) &&\n-\t(cd alttst &&\n-\t git rev-parse --verify refs/remotes/origin/side &&\n-\t test_must_fail git rev-parse --verify refs/remotes/origin/side2 &&\n-\t git fetch alt &&\n-\t git remote prune alt &&\n-\t test_must_fail git rev-parse --verify refs/remotes/origin/side &&\n-\t git rev-parse --verify refs/remotes/origin/side2)\n+\tmkdir alttst &&\n+\t(\n+\t\tcd alttst &&\n+\t\tgit init &&\n+\t\tgit remote add -f origin ../one &&\n+\t\tgit config remote.alt.url ../one &&\n+\t\tgit config remote.alt.fetch \"+refs/heads/*:refs/remotes/origin/*\"\n+\t) &&\n+\t(\n+\t\tcd one &&\n+\t\tgit branch -m side side2\n+\t) &&\n+\t(\n+\t\tcd alttst &&\n+\t\tgit rev-parse --verify refs/remotes/origin/side &&\n+\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side2 &&\n+\t\tgit fetch alt &&\n+\t\tgit remote prune alt &&\n+\t\ttest_must_fail git rev-parse --verify refs/remotes/origin/side &&\n+\t\tgit rev-parse --verify refs/remotes/origin/side2\n+\t)\n '\n \n cat >test/expect <<\\EOF\n@@ -433,20 +481,24 @@ some-tag\n EOF\n \n test_expect_success 'add with reachable tags (default)' '\n-\t(cd one &&\n-\t >foobar &&\n-\t git add foobar &&\n-\t git commit -m \"Foobar\" &&\n-\t git tag -a -m \"Foobar tag\" foobar-tag &&\n-\t git reset --hard HEAD~1 &&\n-\t git tag -a -m \"Some tag\" some-tag) &&\n-\t(mkdir add-tags &&\n-\t cd add-tags &&\n-\t git init &&\n-\t git remote add -f origin ../one &&\n-\t git tag -l some-tag >../test/output &&\n-\t git tag -l foobar-tag >>../test/output &&\n-\t test_must_fail git config remote.origin.tagopt) &&\n+\t(\n+\t\tcd one &&\n+\t\t: >foobar &&\n+\t\tgit add foobar &&\n+\t\tgit commit -m \"Foobar\" &&\n+\t\tgit tag -a -m \"Foobar tag\" foobar-tag &&\n+\t\tgit reset --hard HEAD~1 &&\n+\t\tgit tag -a -m \"Some tag\" some-tag\n+\t) &&\n+\tmkdir add-tags &&\n+\t(\n+\t\tcd add-tags &&\n+\t\tgit init &&\n+\t\tgit remote add -f origin ../one &&\n+\t\tgit tag -l some-tag >../test/output &&\n+\t\tgit tag -l foobar-tag >>../test/output &&\n+\t\ttest_must_fail git config remote.origin.tagopt\n+\t) &&\n \ttest_cmp test/expect test/output\n '\n \n@@ -457,14 +509,16 @@ foobar-tag\n EOF\n \n test_expect_success 'add --tags' '\n-\t(rm -rf add-tags &&\n-\t mkdir add-tags &&\n-\t cd add-tags &&\n-\t git init &&\n-\t git remote add -f --tags origin ../one &&\n-\t git tag -l some-tag >../test/output &&\n-\t git tag -l foobar-tag >>../test/output &&\n-\t git config remote.origin.tagopt >>../test/output) &&\n+\trm -rf add-tags &&\n+\t(\n+\t\tmkdir add-tags &&\n+\t\tcd add-tags &&\n+\t\tgit init &&\n+\t\tgit remote add -f --tags origin ../one &&\n+\t\tgit tag -l some-tag >../test/output &&\n+\t\tgit tag -l foobar-tag >>../test/output &&\n+\t\tgit config remote.origin.tagopt >>../test/output\n+\t) &&\n \ttest_cmp test/expect test/output\n '\n \n@@ -473,25 +527,31 @@ cat >test/expect <<\\EOF\n EOF\n \n test_expect_success 'add --no-tags' '\n-\t(rm -rf add-tags &&\n-\t mkdir add-no-tags &&\n-\t cd add-no-tags &&\n-\t git init &&\n-\t git remote add -f --no-tags origin ../one &&\n-\t git tag -l some-tag >../test/output &&\n-\t git tag -l foobar-tag >../test/output &&\n-\t git config remote.origin.tagopt >>../test/output) &&\n-\t(cd one &&\n-\t git tag -d some-tag foobar-tag) &&\n+\trm -rf add-tags &&\n+\t(\n+\t\tmkdir add-no-tags &&\n+\t\tcd add-no-tags &&\n+\t\tgit init &&\n+\t\tgit remote add -f --no-tags origin ../one &&\n+\t\tgit tag -l some-tag >../test/output &&\n+\t\tgit tag -l foobar-tag >../test/output &&\n+\t\tgit config remote.origin.tagopt >>../test/output\n+\t) &&\n+\t(\n+\t\tcd one &&\n+\t\tgit tag -d some-tag foobar-tag\n+\t) &&\n \ttest_cmp test/expect test/output\n '\n \n test_expect_success 'reject --no-no-tags' '\n-\t(cd add-no-tags &&\n-\t test_must_fail git remote add -f --no-no-tags neworigin ../one)\n+\t(\n+\t\tcd add-no-tags &&\n+\t\ttest_must_fail git remote add -f --no-no-tags neworigin ../one\n+\t)\n '\n \n-cat > one/expect << EOF\n+cat >one/expect <<-\\EOF\n   apis/master\n   apis/side\n   drosophila/another\n@@ -500,17 +560,17 @@ cat > one/expect << EOF\n EOF\n \n test_expect_success 'update' '\n-\n-\t(cd one &&\n-\t git remote add drosophila ../two &&\n-\t git remote add apis ../mirror &&\n-\t git remote update &&\n-\t git branch -r > output &&\n-\t test_cmp expect output)\n-\n+\t(\n+\t\tcd one &&\n+\t\tgit remote add drosophila ../two &&\n+\t\tgit remote add apis ../mirror &&\n+\t\tgit remote update &&\n+\t\tgit branch -r >output &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n-cat > one/expect << EOF\n+cat >one/expect <<-\\EOF\n   drosophila/another\n   drosophila/master\n   drosophila/side\n@@ -521,34 +581,40 @@ cat > one/expect << EOF\n EOF\n \n test_expect_success 'update with arguments' '\n-\n-\t(cd one &&\n-\t for b in $(git branch -r)\n-\t do\n+\t(\n+\t\tcd one &&\n+\t\tfor b in $(git branch -r)\n+\t\tdo\n \t\tgit branch -r -d $b || break\n-\t done &&\n-\t git remote add manduca ../mirror &&\n-\t git remote add megaloprepus ../mirror &&\n-\t git config remotes.phobaeticus \"drosophila megaloprepus\" &&\n-\t git config remotes.titanus manduca &&\n-\t git remote update phobaeticus titanus &&\n-\t git branch -r > output &&\n-\t test_cmp expect output)\n-\n+\t\tdone &&\n+\t\tgit remote add manduca ../mirror &&\n+\t\tgit remote add megaloprepus ../mirror &&\n+\t\tgit config remotes.phobaeticus \"drosophila megaloprepus\" &&\n+\t\tgit config remotes.titanus manduca &&\n+\t\tgit remote update phobaeticus titanus &&\n+\t\tgit branch -r >output &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n test_expect_success 'update --prune' '\n-\n-\t(cd one &&\n-\t git branch -m side2 side3) &&\n-\t(cd test &&\n-\t git remote update --prune &&\n-\t (cd ../one && git branch -m side3 side2) &&\n-\t git rev-parse refs/remotes/origin/side3 &&\n-\t test_must_fail git rev-parse refs/remotes/origin/side2)\n+\t(\n+\t\tcd one &&\n+\t\tgit branch -m side2 side3\n+\t) &&\n+\t(\n+\t\tcd test &&\n+\t\tgit remote update --prune &&\n+\t\t(\n+\t\t\tcd ../one &&\n+\t\t\tgit branch -m side3 side2\n+\t\t) &&\n+\t\tgit rev-parse refs/remotes/origin/side3 &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/side2\n+\t)\n '\n \n-cat > one/expect << EOF\n+cat >one/expect <<-\\EOF\n   apis/master\n   apis/side\n   manduca/master\n@@ -558,117 +624,115 @@ cat > one/expect << EOF\n EOF\n \n test_expect_success 'update default' '\n-\n-\t(cd one &&\n-\t for b in $(git branch -r)\n-\t do\n+\t(\n+\t\tcd one &&\n+\t\tfor b in $(git branch -r)\n+\t\tdo\n \t\tgit branch -r -d $b || break\n-\t done &&\n-\t git config remote.drosophila.skipDefaultUpdate true &&\n-\t git remote update default &&\n-\t git branch -r > output &&\n-\t test_cmp expect output)\n-\n+\t\tdone &&\n+\t\tgit config remote.drosophila.skipDefaultUpdate true &&\n+\t\tgit remote update default &&\n+\t\tgit branch -r >output &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n-cat > one/expect << EOF\n+cat >one/expect <<-\\EOF\n   drosophila/another\n   drosophila/master\n   drosophila/side\n EOF\n \n test_expect_success 'update default (overridden, with funny whitespace)' '\n-\n-\t(cd one &&\n-\t for b in $(git branch -r)\n-\t do\n+\t(\n+\t\tcd one &&\n+\t\tfor b in $(git branch -r)\n+\t\tdo\n \t\tgit branch -r -d $b || break\n-\t done &&\n-\t git config remotes.default \"$(printf \"\\t drosophila  \\n\")\" &&\n-\t git remote update default &&\n-\t git branch -r > output &&\n-\t test_cmp expect output)\n-\n+\t\tdone &&\n+\t\tgit config remotes.default \"$(printf \"\\t drosophila  \\n\")\" &&\n+\t\tgit remote update default &&\n+\t\tgit branch -r >output &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n test_expect_success 'update (with remotes.default defined)' '\n-\n-\t(cd one &&\n-\t for b in $(git branch -r)\n-\t do\n+\t(\n+\t\tcd one &&\n+\t\tfor b in $(git branch -r)\n+\t\tdo\n \t\tgit branch -r -d $b || break\n-\t done &&\n-\t git config remotes.default \"drosophila\" &&\n-\t git remote update &&\n-\t git branch -r > output &&\n-\t test_cmp expect output)\n-\n+\t\tdone &&\n+\t\tgit config remotes.default \"drosophila\" &&\n+\t\tgit remote update &&\n+\t\tgit branch -r >output &&\n+\t\ttest_cmp expect output\n+\t)\n '\n \n test_expect_success '\"remote show\" does not show symbolic refs' '\n-\n \tgit clone one three &&\n-\t(cd three &&\n-\t git remote show origin > output &&\n-\t ! grep \"^ *HEAD$\" < output &&\n-\t ! grep -i stale < output)\n-\n+\t(\n+\t\tcd three &&\n+\t\tgit remote show origin >output &&\n+\t\t! grep \"^ *HEAD$\" < output &&\n+\t\t! grep -i stale < output\n+\t)\n '\n \n test_expect_success 'reject adding remote with an invalid name' '\n-\n \ttest_must_fail git remote add some:url desired-name\n-\n '\n \n # The first three test if the tracking branches are properly renamed,\n # the last two ones check if the config is updated.\n \n test_expect_success 'rename a remote' '\n-\n \tgit clone one four &&\n-\t(cd four &&\n-\t git remote rename origin upstream &&\n-\t rmdir .git/refs/remotes/origin &&\n-\t test \"$(git symbolic-ref refs/remotes/upstream/HEAD)\" = \"refs/remotes/upstream/master\" &&\n-\t test \"$(git rev-parse upstream/master)\" = \"$(git rev-parse master)\" &&\n-\t test \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/remotes/upstream/*\" &&\n-\t test \"$(git config branch.master.remote)\" = \"upstream\")\n-\n+\t(\n+\t\tcd four &&\n+\t\tgit remote rename origin upstream &&\n+\t\trmdir .git/refs/remotes/origin &&\n+\t\ttest \"$(git symbolic-ref refs/remotes/upstream/HEAD)\" = \"refs/remotes/upstream/master\" &&\n+\t\ttest \"$(git rev-parse upstream/master)\" = \"$(git rev-parse master)\" &&\n+\t\ttest \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/remotes/upstream/*\" &&\n+\t\ttest \"$(git config branch.master.remote)\" = \"upstream\"\n+\t)\n '\n \n test_expect_success 'rename does not update a non-default fetch refspec' '\n-\n \tgit clone one four.one &&\n-\t(cd four.one &&\n-\t git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&\n-\t git remote rename origin upstream &&\n-\t test \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/heads/origin/*\" &&\n-\t git rev-parse -q origin/master)\n-\n+\t(\n+\t\tcd four.one &&\n+\t\tgit config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&\n+\t\tgit remote rename origin upstream &&\n+\t\ttest \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/heads/origin/*\" &&\n+\t\tgit rev-parse -q origin/master\n+\t)\n '\n \n test_expect_success 'rename a remote with name part of fetch spec' '\n-\n \tgit clone one four.two &&\n-\t(cd four.two &&\n-\t git remote rename origin remote &&\n-\t git remote rename remote upstream &&\n-\t test \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/remotes/upstream/*\")\n-\n+\t(\n+\t\tcd four.two &&\n+\t\tgit remote rename origin remote &&\n+\t\tgit remote rename remote upstream &&\n+\t\ttest \"$(git config remote.upstream.fetch)\" = \"+refs/heads/*:refs/remotes/upstream/*\"\n+\t)\n '\n \n test_expect_success 'rename a remote with name prefix of other remote' '\n-\n \tgit clone one four.three &&\n-\t(cd four.three &&\n-\t git remote add o git://example.com/repo.git &&\n-\t git remote rename o upstream &&\n-\t test \"$(git rev-parse origin/master)\" = \"$(git rev-parse master)\")\n-\n+\t(\n+\t\tcd four.three &&\n+\t\tgit remote add o git://example.com/repo.git &&\n+\t\tgit remote rename o upstream &&\n+\t\ttest \"$(git rev-parse origin/master)\" = \"$(git rev-parse master)\"\n+\t)\n '\n \n-cat > remotes_origin << EOF\n+cat >remotes_origin <<-EOF\n URL: $(pwd)/one\n Push: refs/heads/master:refs/heads/upstream\n Pull: refs/heads/master:refs/heads/origin\n@@ -677,27 +741,31 @@ EOF\n test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n \torigin_url=$(pwd)/one &&\n-\t(cd five &&\n-\t git remote remove origin &&\n-\t mkdir -p .git/remotes &&\n-\t cat ../remotes_origin > .git/remotes/origin &&\n-\t git remote rename origin origin &&\n-\t ! test -f .git/remotes/origin &&\n-\t test \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n-\t test \"$(git config remote.origin.push)\" = \"refs/heads/master:refs/heads/upstream\" &&\n-\t test \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\")\n+\t(\n+\t\tcd five &&\n+\t\tgit remote remove origin &&\n+\t\tmkdir -p .git/remotes &&\n+\t\tcat ../remotes_origin >.git/remotes/origin &&\n+\t\tgit remote rename origin origin &&\n+\t\t! test -f .git/remotes/origin &&\n+\t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n+\t\ttest \"$(git config remote.origin.push)\" = \"refs/heads/master:refs/heads/upstream\" &&\n+\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n+\t)\n '\n \n test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \tgit clone one six &&\n \torigin_url=$(pwd)/one &&\n-\t(cd six &&\n-\t git remote rm origin &&\n-\t echo \"$origin_url\" > .git/branches/origin &&\n-\t git remote rename origin origin &&\n-\t ! test -f .git/branches/origin &&\n-\t test \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n-\t test \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\")\n+\t(\n+\t\tcd six &&\n+\t\tgit remote rm origin &&\n+\t\techo \"$origin_url\" >.git/branches/origin &&\n+\t\tgit remote rename origin origin &&\n+\t\t! test -f .git/branches/origin &&\n+\t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n+\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n+\t)\n '\n \n test_expect_success 'remote prune to cause a dangling symref' '\n@@ -727,7 +795,6 @@ test_expect_success 'remote prune to cause a dangling symref' '\n '\n \n test_expect_success 'show empty remote' '\n-\n \ttest_create_repo empty &&\n \tgit clone empty empty-clone &&\n \t(\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221672","messageId":"1371887901-5659-3-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 02/14] t/t5505-remote: test push-refspec in branches-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:09Z","receivedAt":"2013-06-22T07:58:09Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"The test \"migrate a remote from named file in $GIT_DIR/branches\" reads\nthe branches-file, but only checks that the url and fetch-refspec are\nset correctly.  Check that the push-refspec is also set correctly.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex f679ded..74ddd77 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -764,7 +764,8 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t\tgit remote rename origin origin &&\n \t\t! test -f .git/branches/origin &&\n \t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n-\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n+\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\" &&\n+\t\ttest \"$(git config remote.origin.push)\" = \"HEAD:refs/heads/master\"\n \t)\n '\n \n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221660","messageId":"1371887901-5659-4-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 03/14] t/t5505-remote: use test_path_is_missing","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:10Z","receivedAt":"2013-06-22T07:58:10Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Replace instances of ! test -f with test_path_is_missing.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 74ddd77..d688662 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -747,7 +747,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t\tmkdir -p .git/remotes &&\n \t\tcat ../remotes_origin >.git/remotes/origin &&\n \t\tgit remote rename origin origin &&\n-\t\t! test -f .git/remotes/origin &&\n+\t\ttest_path_is_missing .git/remotes/origin &&\n \t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n \t\ttest \"$(git config remote.origin.push)\" = \"refs/heads/master:refs/heads/upstream\" &&\n \t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n@@ -762,7 +762,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t\tgit remote rm origin &&\n \t\techo \"$origin_url\" >.git/branches/origin &&\n \t\tgit remote rename origin origin &&\n-\t\t! test -f .git/branches/origin &&\n+\t\ttest_path_is_missing .git/branches/origin &&\n \t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n \t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\" &&\n \t\ttest \"$(git config remote.origin.push)\" = \"HEAD:refs/heads/master\"\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221661","messageId":"1371887901-5659-5-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 04/14] t/t5505-remote: remove dependency on $origin_url","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:11Z","receivedAt":"2013-06-22T07:58:11Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"In the tests \"migrate a remote from named file in\n$GIT_DIR/{remotes,branches}\", we are only checking that a configuration\nis migrated successfully; it has no correspondence with whether or not\nthose values do something sensible with other git\noperations (fetch/push).  Therefore, there is no need to determine\n$origin_url: just substitute it with the constant value \"quux\".\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 10 ++++------\n 1 file changed, 4 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex d688662..13199d1 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -733,14 +733,13 @@ test_expect_success 'rename a remote with name prefix of other remote' '\n '\n \n cat >remotes_origin <<-EOF\n-URL: $(pwd)/one\n+URL: quux\n Push: refs/heads/master:refs/heads/upstream\n Pull: refs/heads/master:refs/heads/origin\n EOF\n \n test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n-\torigin_url=$(pwd)/one &&\n \t(\n \t\tcd five &&\n \t\tgit remote remove origin &&\n@@ -748,7 +747,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t\tcat ../remotes_origin >.git/remotes/origin &&\n \t\tgit remote rename origin origin &&\n \t\ttest_path_is_missing .git/remotes/origin &&\n-\t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n+\t\ttest \"$(git config remote.origin.url)\" = \"quux\" &&\n \t\ttest \"$(git config remote.origin.push)\" = \"refs/heads/master:refs/heads/upstream\" &&\n \t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n \t)\n@@ -756,14 +755,13 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \n test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \tgit clone one six &&\n-\torigin_url=$(pwd)/one &&\n \t(\n \t\tcd six &&\n \t\tgit remote rm origin &&\n-\t\techo \"$origin_url\" >.git/branches/origin &&\n+\t\techo \"quux\" >.git/branches/origin &&\n \t\tgit remote rename origin origin &&\n \t\ttest_path_is_missing .git/branches/origin &&\n-\t\ttest \"$(git config remote.origin.url)\" = \"$origin_url\" &&\n+\t\ttest \"$(git config remote.origin.url)\" = \"quux\" &&\n \t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\" &&\n \t\ttest \"$(git config remote.origin.push)\" = \"HEAD:refs/heads/master\"\n \t)\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221662","messageId":"1371887901-5659-6-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 05/14] remote: remove dead code in read_branches_file()","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:12Z","receivedAt":"2013-06-22T07:58:12Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"The first line of the function checks that the remote-name contains a\nslash ('/'), and sets the \"slash\" variable accordingly.  The only caller\nof read_branches_file() is remote_get_1(); the calling codepath is\nguarded by valid_remote_nick(), which checks that the remote does not\ncontain a slash.  Therefore, the \"slash\" variable can never be set:\nremove the dead code that assumes otherwise.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n remote.c | 26 +++-----------------------\n 1 file changed, 3 insertions(+), 23 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex e71f66d..128b210 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -276,10 +276,9 @@ static void read_remotes_file(struct remote *remote)\n \n static void read_branches_file(struct remote *remote)\n {\n-\tconst char *slash = strchr(remote->name, '/');\n \tchar *frag;\n \tstruct strbuf branch = STRBUF_INIT;\n-\tint n = slash ? slash - remote->name : 1000;\n+\tint n = 1000;\n \tFILE *f = fopen(git_path(\"branches/%.*s\", n, remote->name), \"r\");\n \tchar *s, *p;\n \tint len;\n@@ -299,36 +298,17 @@ static void read_branches_file(struct remote *remote)\n \twhile (isspace(p[-1]))\n \t\t*--p = 0;\n \tlen = p - s;\n-\tif (slash)\n-\t\tlen += strlen(slash);\n \tp = xmalloc(len + 1);\n \tstrcpy(p, s);\n-\tif (slash)\n-\t\tstrcat(p, slash);\n \n-\t/*\n-\t * With \"slash\", e.g. \"git fetch jgarzik/netdev-2.6\" when\n-\t * reading from $GIT_DIR/branches/jgarzik fetches \"HEAD\" from\n-\t * the partial URL obtained from the branches file plus\n-\t * \"/netdev-2.6\" and does not store it in any tracking ref.\n-\t * #branch specifier in the file is ignored.\n-\t *\n-\t * Otherwise, the branches file would have URL and optionally\n-\t * #branch specified.  The \"master\" (or specified) branch is\n-\t * fetched and stored in the local branch of the same name.\n-\t */\n \tfrag = strchr(p, '#');\n \tif (frag) {\n \t\t*(frag++) = '\\0';\n \t\tstrbuf_addf(&branch, \"refs/heads/%s\", frag);\n \t} else\n \t\tstrbuf_addstr(&branch, \"refs/heads/master\");\n-\tif (!slash) {\n-\t\tstrbuf_addf(&branch, \":refs/heads/%s\", remote->name);\n-\t} else {\n-\t\tstrbuf_reset(&branch);\n-\t\tstrbuf_addstr(&branch, \"HEAD:\");\n-\t}\n+\n+\tstrbuf_addf(&branch, \":refs/heads/%s\", remote->name);\n \tadd_url_alias(remote, p);\n \tadd_fetch_refspec(remote, strbuf_detach(&branch, NULL));\n \t/*\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221664","messageId":"1371887901-5659-7-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 06/14] t/t5505-remote: test url-with-# in branches-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:13Z","receivedAt":"2013-06-22T07:58:13Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Add one more test similar to \"migrate a remote from named file in\n$GIT_DIR/branches\" to check that a url with a # can be used to specify\nthe branch name (as opposed to the constant \"master\").\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 22 ++++++++++++++++++----\n 1 file changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 13199d1..229a89c 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -767,27 +767,41 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t)\n '\n \n-test_expect_success 'remote prune to cause a dangling symref' '\n+test_expect_success 'migrate a remote from named file in $GIT_DIR/branches (2)' '\n \tgit clone one seven &&\n \t(\n+\t\tcd seven &&\n+\t\tgit remote rm origin &&\n+\t\techo \"quux#foom\" > .git/branches/origin &&\n+\t\tgit remote rename origin origin &&\n+\t\ttest_path_is_missing .git/branches/origin &&\n+\t\ttest \"$(git config remote.origin.url)\" = \"quux\" &&\n+\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/foom:refs/heads/origin\"\n+\t\ttest \"$(git config remote.origin.push)\" = \"HEAD:refs/heads/foom\"\n+\t)\n+'\n+\n+test_expect_success 'remote prune to cause a dangling symref' '\n+\tgit clone one eight &&\n+\t(\n \t\tcd one &&\n \t\tgit checkout side2 &&\n \t\tgit branch -D master\n \t) &&\n \t(\n-\t\tcd seven &&\n+\t\tcd eight &&\n \t\tgit remote prune origin\n \t) >err 2>&1 &&\n \ttest_i18ngrep \"has become dangling\" err &&\n \n \t: And the dangling symref will not cause other annoying errors &&\n \t(\n-\t\tcd seven &&\n+\t\tcd eight &&\n \t\tgit branch -a\n \t) 2>err &&\n \t! grep \"points nowhere\" err &&\n \t(\n-\t\tcd seven &&\n+\t\tcd eight &&\n \t\ttest_must_fail git branch nomore origin\n \t) 2>err &&\n \tgrep \"dangling symref\" err\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221663","messageId":"1371887901-5659-8-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 07/14] t/t5516-fetch-push: don't use branches-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:14Z","receivedAt":"2013-06-22T07:58:14Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Four tests exercising fetch and push functionality unnecessarily depend\non $GIT_DIR/branches files.  Modern Git does not encourage the use of\nthose files, and the parser remote.c:read_branches_file() is only\nprovided for backward compatibility with older repositories.  We already\nhave tests in t/t5505-remote to verify that the parser works: so,\nsubstitute the $GIT_DIR/branches configuration with an equivalent\ngitconfig-style configuration, using the results of those tests.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5516-fetch-push.sh | 16 ++++++++++++----\n 1 file changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 4691d51..6e9fa84 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -852,9 +852,11 @@ test_expect_success 'fetch with branches' '\n \tmk_empty testrepo &&\n \tgit branch second $the_first_commit &&\n \tgit checkout second &&\n-\techo \"..\" > testrepo/.git/branches/branch1 &&\n \t(\n \t\tcd testrepo &&\n+\t\ttest_config remote.branch1.url \"..\"  &&\n+\t\ttest_config remote.branch1.fetch \"refs/heads/master:refs/heads/branch1\"  &&\n+\t\ttest_config remote.branch1.push \"HEAD:refs/heads/master\"  &&\n \t\tgit fetch branch1 &&\n \t\techo \"$the_commit commit\trefs/heads/branch1\" >expect &&\n \t\tgit for-each-ref refs/heads >actual &&\n@@ -865,9 +867,11 @@ test_expect_success 'fetch with branches' '\n \n test_expect_success 'fetch with branches containing #' '\n \tmk_empty testrepo &&\n-\techo \"..#second\" > testrepo/.git/branches/branch2 &&\n \t(\n \t\tcd testrepo &&\n+\t\ttest_config remote.branch2.url \"..\"  &&\n+\t\ttest_config remote.branch2.fetch \"refs/heads/second:refs/heads/branch2\"  &&\n+\t\ttest_config remote.branch2.push \"HEAD:refs/heads/second\"  &&\n \t\tgit fetch branch2 &&\n \t\techo \"$the_first_commit commit\trefs/heads/branch2\" >expect &&\n \t\tgit for-each-ref refs/heads >actual &&\n@@ -879,7 +883,9 @@ test_expect_success 'fetch with branches containing #' '\n test_expect_success 'push with branches' '\n \tmk_empty testrepo &&\n \tgit checkout second &&\n-\techo \"testrepo\" > .git/branches/branch1 &&\n+\ttest_config remote.branch1.url testrepo &&\n+\ttest_config remote.branch1.fetch \"refs/heads/master:refs/heads/branch1\" &&\n+\ttest_config remote.branch1.push \"HEAD:refs/heads/master\" &&\n \tgit push branch1 &&\n \t(\n \t\tcd testrepo &&\n@@ -891,7 +897,9 @@ test_expect_success 'push with branches' '\n \n test_expect_success 'push with branches containing #' '\n \tmk_empty testrepo &&\n-\techo \"testrepo#branch3\" > .git/branches/branch2 &&\n+\ttest_config remote.branch2.url testrepo &&\n+\ttest_config remote.branch2.fetch \"refs/heads/branch3:refs/heads/branch2\" &&\n+\ttest_config remote.branch2.push \"HEAD:refs/heads/branch3\" &&\n \tgit push branch2 &&\n \t(\n \t\tcd testrepo &&\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221669","messageId":"1371887901-5659-9-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 08/14] ls-remote doc: fix example invocation on git.git","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:15Z","receivedAt":"2013-06-22T07:58:15Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Under the EXAMPLES section, there is one invocation on the git.git\nrepository that attempts to list the refs master, pu, and rc.  The ref\nrc does not exist in today's repository, so remove it.  Among other\nthings, this example demonstrates that the \"<refs>...\" argument is\nsimply a filter; requesting a non-existent ref is not an error.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-ls-remote.txt | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt\nindex 774de5e..cce4f93 100644\n--- a/Documentation/git-ls-remote.txt\n+++ b/Documentation/git-ls-remote.txt\n@@ -70,7 +70,6 @@ EXAMPLES\n \t$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc\n \t5fe978a5381f1fbad26a80e682ddd2a401966740\trefs/heads/master\n \tc781a84b5204fb294c9ccc79f8b3baceeb32c061\trefs/heads/pu\n-\tb1d096f2926c4e37c9c0b6a7bf2119bedaa277cb\trefs/heads/rc\n \t$ echo http://www.kernel.org/pub/scm/git/git.git >.git/branches/public\n \t$ git ls-remote --tags public v\\*\n \td6602ec5194c87b0fc87103ca4d67251c76f233a\trefs/tags/v0.99\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221670","messageId":"1371887901-5659-10-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 09/14] ls-remote doc: rewrite <repository> paragraph","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:16Z","receivedAt":"2013-06-22T07:58:16Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Replace the <repository> paragraph containing specific references to\n$GIT_DIR/branches and \".\" with a generic urls-or-remotes paragraph\nreferencing the relevant sections in the git-fetch(1) manpage.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-ls-remote.txt | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt\nindex cce4f93..283fc0c 100644\n--- a/Documentation/git-ls-remote.txt\n+++ b/Documentation/git-ls-remote.txt\n@@ -48,9 +48,9 @@ OPTIONS\n \texit without talking to the remote.\n \n <repository>::\n-\tLocation of the repository.  The shorthand defined in\n-\t$GIT_DIR/branches/ can be used. Use \".\" (dot) to list references in\n-\tthe local repository.\n+\tThe \"remote\" repository to query.  This parameter can be\n+\teither a URL or the name of a remote (see the GIT URLS and\n+\tREMOTES sections of linkgit:git-fetch[1]).\n \n <refs>...::\n \tWhen unspecified, all references, after filtering done\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221665","messageId":"1371887901-5659-11-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 10/14] ls-remote doc: don't encourage use of branches-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:17Z","receivedAt":"2013-06-22T07:58:17Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"One outdated example encourages the use of $GIT_DIR/branches files.\nReplace it with an equivalent example using a remote.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-ls-remote.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt\nindex 283fc0c..2e22915 100644\n--- a/Documentation/git-ls-remote.txt\n+++ b/Documentation/git-ls-remote.txt\n@@ -70,8 +70,8 @@ EXAMPLES\n \t$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc\n \t5fe978a5381f1fbad26a80e682ddd2a401966740\trefs/heads/master\n \tc781a84b5204fb294c9ccc79f8b3baceeb32c061\trefs/heads/pu\n-\t$ echo http://www.kernel.org/pub/scm/git/git.git >.git/branches/public\n-\t$ git ls-remote --tags public v\\*\n+\t$ git remote add korg http://www.kernel.org/pub/scm/git/git.git\n+\t$ git ls-remote --tags korg v\\*\n \td6602ec5194c87b0fc87103ca4d67251c76f233a\trefs/tags/v0.99\n \tf25a265a342aed6041ab0cc484224d9ca54b6f41\trefs/tags/v0.99.1\n \tc5db5456ae3b0873fc659c19fafdde22313cc441\trefs/tags/v0.99.2\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221668","messageId":"1371887901-5659-12-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:18Z","receivedAt":"2013-06-22T07:58:18Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Extend the test \"migrate a remote from named file in $GIT_DIR/remotes\"\nto test that multiple \"Push:\" and \"Pull:\" lines in the remotes-file\nworks as expected.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5505-remote.sh | 16 ++++++++++++++--\n 1 file changed, 14 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 229a89c..6a622fc 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -735,7 +735,9 @@ test_expect_success 'rename a remote with name prefix of other remote' '\n cat >remotes_origin <<-EOF\n URL: quux\n Push: refs/heads/master:refs/heads/upstream\n+Push: refs/heads/master:refs/heads/upstream2\n Pull: refs/heads/master:refs/heads/origin\n+Pull: refs/heads/master:refs/heads/origin2\n EOF\n \n test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n@@ -748,8 +750,18 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \t\tgit remote rename origin origin &&\n \t\ttest_path_is_missing .git/remotes/origin &&\n \t\ttest \"$(git config remote.origin.url)\" = \"quux\" &&\n-\t\ttest \"$(git config remote.origin.push)\" = \"refs/heads/master:refs/heads/upstream\" &&\n-\t\ttest \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\"\n+\t\tcat >push_expected <<-\\EOF &&\n+\t\trefs/heads/master:refs/heads/upstream\n+\t\trefs/heads/master:refs/heads/upstream2\n+\t\tEOF\n+\t\tcat >fetch_expected <<-\\EOF &&\n+\t\trefs/heads/master:refs/heads/origin\n+\t\trefs/heads/master:refs/heads/origin2\n+\t\tEOF\n+\t\tgit config --get-all remote.origin.push >push_actual &&\n+\t\tgit config --get-all remote.origin.fetch >fetch_actual &&\n+\t\ttest_cmp push_expected push_actual &&\n+\t\ttest_cmp fetch_expected fetch_actual\n \t)\n '\n \n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221671","messageId":"1371887901-5659-13-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 12/14] t/t5510-fetch: don't use remotes-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:19Z","receivedAt":"2013-06-22T07:58:19Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Replace it with the equivalent gitconfig configuration, using the\nresults of a test in t/t5505-remote.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5510-fetch.sh | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex fde6891..47aeac2 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -46,12 +46,9 @@ test_expect_success \"clone and setup child repos\" '\n \t\tcd three &&\n \t\tgit config branch.master.remote two &&\n \t\tgit config branch.master.merge refs/heads/one &&\n-\t\tmkdir -p .git/remotes &&\n-\t\t{\n-\t\t\techo \"URL: ../two/.git/\"\n-\t\t\techo \"Pull: refs/heads/master:refs/heads/two\"\n-\t\t\techo \"Pull: refs/heads/one:refs/heads/one\"\n-\t\t} >.git/remotes/two\n+\t\tgit config remote.two.url \"../two/.git/\" &&\n+\t\tgit config remote.two.fetch \"refs/heads/master:refs/heads/two\" &&\n+\t\tgit config --add remote.two.fetch \"refs/heads/one:refs/heads/one\"\n \t) &&\n \tgit clone . bundle &&\n \tgit clone . seven\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221667","messageId":"1371887901-5659-14-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 13/14] t/t5515-fetch-merge-logic: don't use {branches,remotes}-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:20Z","receivedAt":"2013-06-22T07:58:20Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Replace it with the equivalent gitconfig configuration, using the\nresults of the corresponding tests in t/t5505-remote.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t5515-fetch-merge-logic.sh | 28 +++++++++++++---------------\n 1 file changed, 13 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex dbb927d..cde44e0 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -55,27 +55,25 @@ test_expect_success setup '\n \tgit config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n \tremotes=\"$remotes config-glob\" &&\n \n-\tmkdir -p .git/remotes &&\n-\t{\n-\t\techo \"URL: ../.git/\"\n-\t\techo \"Pull: refs/heads/master:remotes/rem/master\"\n-\t\techo \"Pull: refs/heads/one:remotes/rem/one\"\n-\t\techo \"Pull: two:remotes/rem/two\"\n-\t\techo \"Pull: refs/heads/three:remotes/rem/three\"\n-\t} >.git/remotes/remote-explicit &&\n+\tgit config remote.remote-explicit.url ../.git/ &&\n+\tgit config remote.remote-explicit.fetch refs/heads/master:remotes/rem/master &&\n+\tgit config --add remote.remote-explicit.fetch refs/heads/one:remotes/rem/one &&\n+\tgit config --add remote.remote-explicit.fetch two:remotes/rem/two &&\n+\tgit config --add remote.remote-explicit.fetch refs/heads/three:remotes/rem/three &&\n \tremotes=\"$remotes remote-explicit\" &&\n \n-\t{\n-\t\techo \"URL: ../.git/\"\n-\t\techo \"Pull: refs/heads/*:refs/remotes/rem/*\"\n-\t} >.git/remotes/remote-glob &&\n+\tgit config remote.remote-glob.url ../.git/ &&\n+\tgit config remote.remote-glob.fetch refs/heads/*:refs/remotes/rem/* &&\n \tremotes=\"$remotes remote-glob\" &&\n \n-\tmkdir -p .git/branches &&\n-\techo \"../.git\" > .git/branches/branches-default &&\n+\tgit config remote.branches-default.url ../.git/ &&\n+\tgit config remote.branches-default.fetch refs/heads/master:refs/heads/branches-default &&\n+\tgit config remote.branches-default.push HEAD:refs/heads/master &&\n \tremotes=\"$remotes branches-default\" &&\n \n-\techo \"../.git#one\" > .git/branches/branches-one &&\n+\tgit config remote.branches-one.url ../.git/ &&\n+\tgit config remote.branches-one.fetch refs/heads/one:refs/heads/branches-one &&\n+\tgit config remote.branches-one.push HEAD:refs/heads/one &&\n \tremotes=\"$remotes branches-one\" &&\n \n \tfor remote in $remotes ; do\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221666","messageId":"1371887901-5659-15-git-send-email-artagnon@gmail.com","threadId":"34249","inReplyTo":"1371887901-5659-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2 14/14] remote: add comment about read_{branches,remotes}_file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T07:58:21Z","receivedAt":"2013-06-22T07:58:21Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Explain that they are fringe features.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n remote.c | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/remote.c b/remote.c\nindex 128b210..f980928 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -227,6 +227,10 @@ static void add_instead_of(struct rewrite *rewrite, const char *instead_of)\n \trewrite->instead_of_nr++;\n }\n \n+/*\n+ * Fringe feature.  Modern Git encourages the use of gitconfig instead\n+ * of remotes-file.\n+ */\n static void read_remotes_file(struct remote *remote)\n {\n \tFILE *f = fopen(git_path(\"remotes/%s\", remote->name), \"r\");\n@@ -274,6 +278,10 @@ static void read_remotes_file(struct remote *remote)\n \tfclose(f);\n }\n \n+/*\n+ * Fringe feature.  Modern Git encourages the use of gitconfig instead\n+ * of branches-file.\n+ */\n static void read_branches_file(struct remote *remote)\n {\n \tchar *frag;\n-- \n1.8.3.1.498.gacf2885\n"},{"id":"221703","messageId":"7v38s9i9ai.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"1371887901-5659-6-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2 05/14] remote: remove dead code in read_branches_file()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T07:19:17Z","receivedAt":"2013-06-23T07:19:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> -\t/*\n> -\t * With \"slash\", e.g. \"git fetch jgarzik/netdev-2.6\" when\n> -\t * reading from $GIT_DIR/branches/jgarzik fetches \"HEAD\" from\n> -\t * the partial URL obtained from the branches file plus\n> -\t * \"/netdev-2.6\" and does not store it in any tracking ref.\n> -\t * #branch specifier in the file is ignored.\n> -\t *\n> -\t * Otherwise, the branches file would have URL and optionally\n> -\t * #branch specified.  The \"master\" (or specified) branch is\n> -\t * fetched and stored in the local branch of the same name.\n> -\t */\n\nRemoval of the second paratraph is wrong, isn't it?\n\n>  \tfrag = strchr(p, '#');\n>  \tif (frag) {\n>  \t\t*(frag++) = '\\0';\n>  \t\tstrbuf_addf(&branch, \"refs/heads/%s\", frag);\n>  \t} else\n>  \t\tstrbuf_addstr(&branch, \"refs/heads/master\");\n> -\tif (!slash) {\n> -\t\tstrbuf_addf(&branch, \":refs/heads/%s\", remote->name);\n> -\t} else {\n> -\t\tstrbuf_reset(&branch);\n> -\t\tstrbuf_addstr(&branch, \"HEAD:\");\n> -\t}\n> +\n> +\tstrbuf_addf(&branch, \":refs/heads/%s\", remote->name);\n>  \tadd_url_alias(remote, p);\n>  \tadd_fetch_refspec(remote, strbuf_detach(&branch, NULL));\n>  \t/*\n"},{"id":"221704","messageId":"7vy5a1guk4.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"1371887901-5659-9-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T07:22:51Z","receivedAt":"2013-06-23T07:22:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Under the EXAMPLES section, there is one invocation on the git.git\n> repository that attempts to list the refs master, pu, and rc.  The ref\n> rc does not exist in today's repository, so remove it.  Among other\n> things, this example demonstrates that the \"<refs>...\" argument is\n> simply a filter; requesting a non-existent ref is not an error.\n\nThese last two lines are better be in the documentation, no?\n\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Documentation/git-ls-remote.txt | 1 -\n>  1 file changed, 1 deletion(-)\n>\n> diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt\n> index 774de5e..cce4f93 100644\n> --- a/Documentation/git-ls-remote.txt\n> +++ b/Documentation/git-ls-remote.txt\n> @@ -70,7 +70,6 @@ EXAMPLES\n>  \t$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc\n>  \t5fe978a5381f1fbad26a80e682ddd2a401966740\trefs/heads/master\n>  \tc781a84b5204fb294c9ccc79f8b3baceeb32c061\trefs/heads/pu\n> -\tb1d096f2926c4e37c9c0b6a7bf2119bedaa277cb\trefs/heads/rc\n>  \t$ echo http://www.kernel.org/pub/scm/git/git.git >.git/branches/public\n>  \t$ git ls-remote --tags public v\\*\n>  \td6602ec5194c87b0fc87103ca4d67251c76f233a\trefs/tags/v0.99\n"},{"id":"221706","messageId":"7vehbtgto1.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"1371887901-5659-2-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2 01/14] t/t5505-remote: modernize style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T07:42:06Z","receivedAt":"2013-06-23T07:42:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Modernize the style of all tests throughout the file:\n> - Remove spurious blank lines.\n> - Indent the test body.\n> - Make sure that all lines end with &&, to make it easier to spot breaks\n>   in the chain.\n> - When executing something in a subshell, put the parenthesis on\n>   separate lines and indent the body.  Also make sure that the first\n>   statement in the subshell is a 'cd'.\n> - When redirecting output, replace the > output forms with >output.\n> - Use the <<-\\EOF and <<-EOF forms of heredoc, not <<EOF.  Also, don't\n>   de-indent the heredoc body.\n> - When creating an empty file, use : >output form over >output for\n>   clarity.\n\nEverything except the last one is good, I think.\n\nFor the last one, I prefer \">output\" moderately over \": >output\", as\nboth are equally clear to people who write shell scripts, but this\npreference is not strong enough to make me change \": >output\" that\nis originally in the file to \">output\" in a patch.  In the very old\ndays, there were some implementations of shells that mishandled\n\">output\" but those days are long gone.\n\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  t/t5505-remote.sh | 813 +++++++++++++++++++++++++++++-------------------------\n>  1 file changed, 440 insertions(+), 373 deletions(-)\n>\n> -cat > test/expect << EOF\n> ...\n> +cat >test/expect <<-EOF\n>  * remote origin\n>    Fetch URL: $(pwd)/one\n>    Push  URL: $(pwd)/one\n\nThis one is questionable; if it is not indented with HT, there is no\npoint using the -EOF form.\n\n> -cat > test/expect << EOF\n> ...\n> +cat >test/expect <<-EOF\n\nLikewise.\n\n> @@ -219,152 +220,187 @@ cat > test/expect << EOF\n>  EOF\n>  \n>  test_expect_success 'show -n' '\n> -\t(mv one one.unreachable &&\n> -\t cd test &&\n> ...\n> +\tmv one one.unreachable &&\n> +\t(\n> +\t\tcd test &&\n\nThis is more than an indentation change, but I think it is a good\none.  I saw some others that moved \"mkdir\" out of the subshell to\nchdir into that directory, which are also good changes.\n\n>  cat >test/expect <<\\EOF\n\nFunny that you did not touch this one.\n\n> -cat > one/expect << EOF\n> +cat >one/expect <<-\\EOF\n>    apis/master\n\nBut this again is an unnecessary use of <<-\n\nThis smells like a largely blind conversion done with a script,\nwhich needs a human proof-reader other than the submitter;\neverything else looked good.\n\n\nI'll queue with this fix-up squashed in.\n\n\n t/t5505-remote.sh | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex f679ded..0e7dfa2 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -107,7 +107,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' '\n \t\tcheck_remote_track origin master side &&\n \t\tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n \t\tsed -e \"/^refs\\/remotes\\/origin\\//d\" >actual &&\n-\t\t: >expect &&\n+\t\t>expect &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -139,7 +139,7 @@ test_expect_success 'remove remote protects local branches' '\n \t)\n '\n \n-cat >test/expect <<-EOF\n+cat >test/expect <<EOF\n * remote origin\n   Fetch URL: $(pwd)/one\n   Push  URL: $(pwd)/one\n@@ -202,7 +202,7 @@ test_expect_success 'show' '\n \t)\n '\n \n-cat >test/expect <<-EOF\n+cat >test/expect <<EOF\n * remote origin\n   Fetch URL: $(pwd)/one\n   Push  URL: $(pwd)/one\n@@ -262,7 +262,7 @@ test_expect_success 'set-head --auto' '\n \t)\n '\n \n-cat >test/expect <<-\\EOF\n+cat >test/expect <<\\EOF\n error: Multiple remote HEAD branches. Please choose one explicitly with:\n   git remote set-head two another\n   git remote set-head two master\n@@ -276,7 +276,7 @@ test_expect_success 'set-head --auto fails w/multiple HEADs' '\n \t)\n '\n \n-cat >test/expect <<-\\EOF\n+cat >test/expect <<\\EOF\n refs/remotes/origin/side2\n EOF\n \n@@ -290,7 +290,7 @@ test_expect_success 'set-head explicit' '\n \t)\n '\n \n-cat >test/expect <<-EOF\n+cat >test/expect <<EOF\n Pruning origin\n URL: $(pwd)/one\n  * [would prune] origin/side2\n@@ -483,7 +483,7 @@ EOF\n test_expect_success 'add with reachable tags (default)' '\n \t(\n \t\tcd one &&\n-\t\t: >foobar &&\n+\t\t>foobar &&\n \t\tgit add foobar &&\n \t\tgit commit -m \"Foobar\" &&\n \t\tgit tag -a -m \"Foobar tag\" foobar-tag &&\n@@ -551,7 +551,7 @@ test_expect_success 'reject --no-no-tags' '\n \t)\n '\n \n-cat >one/expect <<-\\EOF\n+cat >one/expect <<\\EOF\n   apis/master\n   apis/side\n   drosophila/another\n@@ -570,7 +570,7 @@ test_expect_success 'update' '\n \t)\n '\n \n-cat >one/expect <<-\\EOF\n+cat >one/expect <<\\EOF\n   drosophila/another\n   drosophila/master\n   drosophila/side\n@@ -637,7 +637,7 @@ test_expect_success 'update default' '\n \t)\n '\n \n-cat >one/expect <<-\\EOF\n+cat >one/expect <<\\EOF\n   drosophila/another\n   drosophila/master\n   drosophila/side\n@@ -732,7 +732,7 @@ test_expect_success 'rename a remote with name prefix of other remote' '\n \t)\n '\n \n-cat >remotes_origin <<-EOF\n+cat >remotes_origin <<EOF\n URL: $(pwd)/one\n Push: refs/heads/master:refs/heads/upstream\n Pull: refs/heads/master:refs/heads/origin\n"},{"id":"221707","messageId":"CALkWK0=wMhSHOU1m-vUMshXbdKNu1TrY_mPCxdWKLOYY-O7YAw@mail.gmail.com","threadId":"34249","inReplyTo":"7vehbtgto1.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 01/14] t/t5505-remote: modernize style","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-23T07:50:11Z","receivedAt":"2013-06-23T07:50:11Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> This smells like a largely blind conversion done with a script,\n\nIt is :)\n\n> I'll queue with this fix-up squashed in.\n\nThanks; I really appreciate it.\n"},{"id":"221709","messageId":"CALkWK0=LRe9V7ETdEAZ7bBEDPFcTv=4cdcAE=CdNA_Xx76+LcQ@mail.gmail.com","threadId":"34249","inReplyTo":"7vy5a1guk4.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-23T07:53:43Z","receivedAt":"2013-06-23T07:53:43Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>\n>> Under the EXAMPLES section, there is one invocation on the git.git\n>> repository that attempts to list the refs master, pu, and rc.  The ref\n>> rc does not exist in today's repository, so remove it.  Among other\n>> things, this example demonstrates that the \"<refs>...\" argument is\n>> simply a filter; requesting a non-existent ref is not an error.\n>\n> These last two lines are better be in the documentation, no?\n\nYou're no happy with the existing documentation?\n\n<refs>...::\n\tWhen unspecified, all references, after filtering done\n\twith --heads and --tags, are shown.  When <refs>... are\n\tspecified, only references matching the given patterns\n\tare displayed.\n"},{"id":"221711","messageId":"7vvc55fe1s.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"CALkWK0=LRe9V7ETdEAZ7bBEDPFcTv=4cdcAE=CdNA_Xx76+LcQ@mail.gmail.com","subject":"Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T08:04:47Z","receivedAt":"2013-06-23T08:04:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>>\n>>> Under the EXAMPLES section, there is one invocation on the git.git\n>>> repository that attempts to list the refs master, pu, and rc.  The ref\n>>> rc does not exist in today's repository, so remove it.  Among other\n>>> things, this example demonstrates that the \"<refs>...\" argument is\n>>> simply a filter; requesting a non-existent ref is not an error.\n>>\n>> These last two lines are better be in the documentation, no?\n>\n> You're no happy with the existing documentation?\n\nI am not so happy with the existing EXAMPLE.  Lazy people (myself\nincluded when trying to figure out other people's software) jump\nstraight to the EXAMPLES section without reading the main body.\n\nEspecially for these people, it makes tons of difference if a sample\ncommand is accompanied by an explanation of key points the example\ntries to illustrate.  In this particular manual page, there are a\ncouple of commands and its sample output listed but nothing else.\n"},{"id":"221712","messageId":"7vobaxfdx9.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"1371887901-5659-12-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T08:07:30Z","receivedAt":"2013-06-23T08:07:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Extend the test \"migrate a remote from named file in $GIT_DIR/remotes\"\n> to test that multiple \"Push:\" and \"Pull:\" lines in the remotes-file\n> works as expected.\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  t/t5505-remote.sh | 16 ++++++++++++++--\n>  1 file changed, 14 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\n> index 229a89c..6a622fc 100755\n> --- a/t/t5505-remote.sh\n> +++ b/t/t5505-remote.sh\n> @@ -735,7 +735,9 @@ test_expect_success 'rename a remote with name prefix of other remote' '\n>  cat >remotes_origin <<-EOF\n>  URL: quux\n>  Push: refs/heads/master:refs/heads/upstream\n> +Push: refs/heads/master:refs/heads/upstream2\n>  Pull: refs/heads/master:refs/heads/origin\n> +Pull: refs/heads/master:refs/heads/origin2\n>  EOF\n\nI do not think we ever designed this to get 'master' pushed to\nupdate two separate destination branches or their 'master' to update\nour two separate tracking branches.\n\nIf you want to make things more realistic like you did in 08/14, I\ndo not see a point to change the tests that is already done for a\nuseful and realistic case by making it deliberately less realistic.\n\nThe same comment applies to the bogus quux URL from the patch 04/14.\n\nI'll reject 04/14 and tweak this patch to use 'next' for the new ref\nmappings, not duplicated 'master'.\n\nPatches 07/14, 12/14, 13/14, and 14/14 are bad idea (these will not\nbe queued on tonight's pushout of 'pu'; neither 04/14 will be).  We\nmay not be encouraging, but that is very different from deprecating\nthe original mechanisms.  The tests that depend on them to work\nshould be kept.  Otherwise, we will never know when we break them\nlike we did at df93e33c accidenally.\n\nIf we want to have tests that exercise the equivalents spelled with\nthe modern in-config mechanism, they should be added as new tests,\nnot by replacing the existing ones.\n"},{"id":"221714","messageId":"CALkWK0nFySj_Xztfwjp=FAhz=dBxgmwZ9YG=PY=7HZLfw0P8aw@mail.gmail.com","threadId":"34249","inReplyTo":"7vobaxfdx9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-23T08:28:45Z","receivedAt":"2013-06-23T08:28:45Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> I'll reject 04/14 and tweak this patch to use 'next' for the new ref\n> mappings, not duplicated 'master'.\n\nIt's a matter of taste: I don't like \"realistic\" (albeit misleading)\nvalues when I'm testing configuration variables, while you think they\nmake the tests more readable.  Fine.\n\n> Patches 07/14, 12/14, 13/14, and 14/14 are bad idea (these will not\n> be queued on tonight's pushout of 'pu'; neither 04/14 will be).  We\n> may not be encouraging, but that is very different from deprecating\n> the original mechanisms.  The tests that depend on them to work\n> should be kept.  Otherwise, we will never know when we break them\n> like we did at df93e33c accidenally.\n>\n> If we want to have tests that exercise the equivalents spelled with\n> the modern in-config mechanism, they should be added as new tests,\n> not by replacing the existing ones.\n\nI disagree.  It is trivial to prove that the tests in t/remote will\nbreak if this fringe feature breaks: I don't know where \"we will never\nknow when we break them\" is coming from.  Why should I know about this\nfringe feature when I'm reading/writing tests for fetch-merge-logic?\nAnd what is _advantage_ of depending on this fringe feature when\ntesting fetch-merge-logic?  More tests break?\n\nBut whatever.  I've already spent more time discussing (bikeshedding?)\nthis series than writing it.  I regret having written a stupid cleanup\nseries with no real consequence now; I'll be less likely to make the\nsame mistake again in the future.\n\nThanks.\n"},{"id":"221744","messageId":"7vr4fsebul.fsf@alter.siamese.dyndns.org","threadId":"34249","inReplyTo":"CALkWK0nFySj_Xztfwjp=FAhz=dBxgmwZ9YG=PY=7HZLfw0P8aw@mail.gmail.com","subject":"Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-23T21:49:54Z","receivedAt":"2013-06-23T21:49:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> I disagree.  It is trivial to prove that the tests in t/remote will\n> break if this fringe feature breaks: I don't know where \"we will never\n> know when we break them\" is coming from.  \n\nIf you remove tests that configure the remotes via the .git/branches\nand the .git/remotes mechanism to lose test coverage, and then\nremove the call to read_branches_file() or read_remotes_file() from\nremote_get_1(), how would you make sure these tests that originally\nexpected these configuration mechanisms to work notice the change in\nbehaviour?\n\n> Why should I know about this\n> fringe feature when I'm reading/writing tests for fetch-merge-logic?\n\nThat is exactly why I asked you at the very beginning:\n\n    I say \"minor\" only because I think the cost of keeping these old\n    mechanisms alive is very low (if it is a heavy burden on the\n    maintenance, please tell me and how).\n\nIf we are not deprecating and keeping them alive, anybody who is\ntouching the codepath to deal with \"struct remote\" should be at\nleast aware of these mechanisms to keep them working.  If it is a\nheavy burden to do so, then keeping them alive is not \"minor\" at\nall.\n\nI've been operating under the assumption, from your response to the\nmessage in the original discussion in v1, that we are in agreement\nthat we are not deprecating or removing them.\n\nAnd if we are deliberately keeping them alive, there is no need for\nyou to paint them \"fringe\".  You may not use it, and you can write\nin your blog or e-mail or whategver that you do not use it, but that\nlabel does not belong to our codebase and documentation as long as\nwe are keeping them as supported feature.\n\nOf course, .git/branches, being a single liner format, will not get\nextended to support richer features that in-config remotes will\nlearn, so you cannot build on existing tests that use the mechanism\nto show new features.  You would need to introduce tests based on\nthe in-config remotes to demonstrate new features such as the\nsupport for triangular workflow.\n\nBecause the .git/remotes/ files are designed to be extensible by\nintroducing new fields, theoretically it may be possible to extend\nit to support new features, but we will not.  We will keep existing\nusers' existing use cases before new features are introduced in\nrecent Git alive, without adding anything new.  People will be\nmigrated out of these old mechanisms over time that way.\n"},{"id":"221933","messageId":"CALkWK0kdWe+rj1gLX2QX6Ra3BjbQrr6muCHKN1c1a+8W3hpdfQ@mail.gmail.com","threadId":"34249","inReplyTo":"CA+gHt1B1pKz5iU+9m_gi36u7g91qZqgdkY97WDAWjRGxu-Vjuw@mail.gmail.com","subject":"Re: [PATCH v2 13/14] t/t5515-fetch-merge-logic: don't use {branches,remotes}-file","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-25T10:20:30Z","receivedAt":"2013-06-25T10:20:30Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Santi Béjar wrote:\n> If you think it's not worth testing the merge logic with remotes in\n> {branches,remotes}-files you can consider just removing these remotes and\n> the associated result files.\n\nThanks, but Junio has already decided to keep them and dropped these patches.\n"}]}