{"thread":{"id":"18218","subject":"[PATCH 0/2] Move push logic to transport.c","startedAt":"2009-03-09T01:06:01Z","lastAt":"2009-03-09T18:44:55Z","messageCount":11,"participants":["Daniel Barkalow","Johannes Schindelin","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"107418","messageId":"alpine.LNX.1.00.0903082046280.19665@iabervon.org","threadId":"18218","inReplyTo":null,"subject":"[PATCH 0/2] Move push logic to transport.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T01:06:01Z","receivedAt":"2009-03-09T01:06:01Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Currently, send_pack() does the work of figuring out what the refspecs \nmean before pushing (with the help of functions from remote.c), updating \nlocal state afterwards, and reporting what it did.\n\nTransports other than the native protocol use the same logic for the first \nof these, and don't do the other two at all. In order to be able to share \nmore code and make it easier to be consist, move the logic to \ntransport_push. This is also more similar to how fetch is organized, \nalthough fetch puts most of the logic in builtin-fetch, which isn't really \nfeasible until all of the transports are converted to the new functions, \nand may be less convenient anyway.\n\nThis series only goes as far as adding a new \"push_refs\" method to struct \ntransport and using it for the git native transport. It doesn't convert \nhttp-push or the rsync transports, largely because I don't have test \nsetups for rsync or webdav to make sure that they're still working.\n\nIt also leaves copies of matching, updating, and reporting code in \nbuiltin-send-pack, but these are only used for \"git send-pack\", and are \nnot used in the code paths for \"git push\". Hopefully, we can deprecate the \nprotocol-specific command at some point in favor of just using \"git push\".\n\nThis is on top of next for Jay's patch to make get_local_heads() common.\n\nDaniel Barkalow (2):\n  Use a common function to get the pretty name of refs\n  Move push matching and reporting logic into transport.c\n\n builtin-fetch.c     |    6 +-\n builtin-send-pack.c |  153 +++++++++++++--------------\n refs.c              |   10 ++\n refs.h              |    2 +\n send-pack.h         |    6 +-\n transport.c         |  283 +++++++++++++++++++++++++++++++++++++++++++++++----\n transport.h         |    3 +-\n 7 files changed, 356 insertions(+), 107 deletions(-)\n"},{"id":"107441","messageId":"alpine.DEB.1.00.0903091033330.10279@pacific.mpi-cbg.de","threadId":"18218","inReplyTo":"alpine.LNX.1.00.0903082046280.19665@iabervon.org","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T09:35:45Z","receivedAt":"2009-03-09T09:35:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 8 Mar 2009, Daniel Barkalow wrote:\n\n> It doesn't convert http-push or the rsync transports, largely because I \n> don't have test setups for rsync or webdav to make sure that they're \n> still working.\n\n$ ls t/*http-push*\nt/t5540-http-push.sh\n\n$ git grep -n test.*rsync t/\nt/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\nt/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\nt/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n\nIt should be just a matter of installing an apache and rsync.\n\nBTW thanks for the patch, I guess it will help Peff to complete \"push \n--track\" properly ;-)\n\nCiao,\nDscho\n"},{"id":"107457","messageId":"20090309141457.GA20708@coredump.intra.peff.net","threadId":"18218","inReplyTo":"alpine.DEB.1.00.0903091033330.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-09T14:14:58Z","receivedAt":"2009-03-09T14:14:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 09, 2009 at 10:35:45AM +0100, Johannes Schindelin wrote:\n\n> BTW thanks for the patch, I guess it will help Peff to complete \"push \n> --track\" properly ;-)\n\nIf I wait long enough, maybe my original patch will Just Work. ;)\n\n-Peff\n"},{"id":"107473","messageId":"alpine.LNX.1.00.0903091200150.19665@iabervon.org","threadId":"18218","inReplyTo":"alpine.DEB.1.00.0903091033330.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T16:04:21Z","receivedAt":"2009-03-09T16:04:21Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> \n> > It doesn't convert http-push or the rsync transports, largely because I \n> > don't have test setups for rsync or webdav to make sure that they're \n> > still working.\n> \n> $ ls t/*http-push*\n> t/t5540-http-push.sh\n> \n> $ git grep -n test.*rsync t/\n> t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> \n> It should be just a matter of installing an apache and rsync.\n\nAnd configuring them suitably, yes. That's the part I haven't previously \ndone.\n\n> BTW thanks for the patch, I guess it will help Peff to complete \"push \n> --track\" properly ;-)\n\nYes, I expect so.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"107475","messageId":"alpine.DEB.1.00.0903091711180.6358@intel-tinevez-2-302","threadId":"18218","inReplyTo":"alpine.LNX.1.00.0903091200150.19665@iabervon.org","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T16:12:17Z","receivedAt":"2009-03-09T16:12:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 9 Mar 2009, Daniel Barkalow wrote:\n\n> On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> \n> > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > \n> > > It doesn't convert http-push or the rsync transports, largely \n> > > because I don't have test setups for rsync or webdav to make sure \n> > > that they're still working.\n> > \n> > $ ls t/*http-push*\n> > t/t5540-http-push.sh\n> > \n> > $ git grep -n test.*rsync t/\n> > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > \n> > It should be just a matter of installing an apache and rsync.\n> \n> And configuring them suitably, yes. That's the part I haven't previously \n> done.\n\nIf you have to configure apache (or rsync) for the test to run properly, \nwe have a serious bug in our test suite.  Please share the output in that \ncase.\n\nCiao,\nDscho\n"},{"id":"107479","messageId":"alpine.LNX.1.00.0903091230430.19665@iabervon.org","threadId":"18218","inReplyTo":"alpine.DEB.1.00.0903091711180.6358@intel-tinevez-2-302","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T16:57:07Z","receivedAt":"2009-03-09T16:57:07Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> \n> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > \n> > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > > \n> > > > It doesn't convert http-push or the rsync transports, largely \n> > > > because I don't have test setups for rsync or webdav to make sure \n> > > > that they're still working.\n> > > \n> > > $ ls t/*http-push*\n> > > t/t5540-http-push.sh\n> > > \n> > > $ git grep -n test.*rsync t/\n> > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > > \n> > > It should be just a matter of installing an apache and rsync.\n> > \n> > And configuring them suitably, yes. That's the part I haven't previously \n> > done.\n> \n> If you have to configure apache (or rsync) for the test to run properly, \n> we have a serious bug in our test suite.  Please share the output in that \n> case.\n\nrsync: failed to connect to 127.0.0.1: Connection refused (111)\nrsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]\nfatal: Could not run rsync to get refs\n\nI mean, I won't need to do anything really special in the configuration, \nbut I do need to have rsyncd running giving access to that directory \nwithout any funny mapping on localhost.\n\nThe apache test does, in fact, run its own server, so that should be easy \nenough (although I do need to install an apache with mod_dav.so, which I \ndon't have handy).\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"107483","messageId":"alpine.DEB.1.00.0903091809330.6358@intel-tinevez-2-302","threadId":"18218","inReplyTo":"alpine.LNX.1.00.0903091230430.19665@iabervon.org","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T17:11:55Z","receivedAt":"2009-03-09T17:11:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 9 Mar 2009, Daniel Barkalow wrote:\n\n> On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> \n> > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > \n> > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > \n> > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > > > \n> > > > > It doesn't convert http-push or the rsync transports, largely \n> > > > > because I don't have test setups for rsync or webdav to make sure \n> > > > > that they're still working.\n> > > > \n> > > > $ ls t/*http-push*\n> > > > t/t5540-http-push.sh\n> > > > \n> > > > $ git grep -n test.*rsync t/\n> > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > > > \n> > > > It should be just a matter of installing an apache and rsync.\n> > > \n> > > And configuring them suitably, yes. That's the part I haven't previously \n> > > done.\n> > \n> > If you have to configure apache (or rsync) for the test to run properly, \n> > we have a serious bug in our test suite.  Please share the output in that \n> > case.\n> \n> rsync: failed to connect to 127.0.0.1: Connection refused (111)\n> rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]\n> fatal: Could not run rsync to get refs\n> \n> I mean, I won't need to do anything really special in the configuration, \n> but I do need to have rsyncd running giving access to that directory \n> without any funny mapping on localhost.\n\nThat is my mistake, I guess.  I tried to be lazy and not change \ntransport.c so that it groks \"rsync:$(pwd)\" style paths.\n\nSorry,\nDscho\n"},{"id":"107485","messageId":"alpine.LNX.1.00.0903091315440.19665@iabervon.org","threadId":"18218","inReplyTo":"alpine.DEB.1.00.0903091809330.6358@intel-tinevez-2-302","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T17:24:43Z","receivedAt":"2009-03-09T17:24:43Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> \n> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > \n> > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > > \n> > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > > \n> > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > > > > \n> > > > > > It doesn't convert http-push or the rsync transports, largely \n> > > > > > because I don't have test setups for rsync or webdav to make sure \n> > > > > > that they're still working.\n> > > > > \n> > > > > $ ls t/*http-push*\n> > > > > t/t5540-http-push.sh\n> > > > > \n> > > > > $ git grep -n test.*rsync t/\n> > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > > > > \n> > > > > It should be just a matter of installing an apache and rsync.\n> > > > \n> > > > And configuring them suitably, yes. That's the part I haven't previously \n> > > > done.\n> > > \n> > > If you have to configure apache (or rsync) for the test to run properly, \n> > > we have a serious bug in our test suite.  Please share the output in that \n> > > case.\n> > \n> > rsync: failed to connect to 127.0.0.1: Connection refused (111)\n> > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]\n> > fatal: Could not run rsync to get refs\n> > \n> > I mean, I won't need to do anything really special in the configuration, \n> > but I do need to have rsyncd running giving access to that directory \n> > without any funny mapping on localhost.\n> \n> That is my mistake, I guess.  I tried to be lazy and not change \n> transport.c so that it groks \"rsync:$(pwd)\" style paths.\n\nOh, I think it's probably not worth allowing rsync:$(pwd) (particularly \nsince rsync itself seems not to let you say \"rsync:\" for local paths). \nI'll set something up to run rsyncd with an appropriate config, like the \nlib-httpd stuff. Oh, and it looks like nobody actually runs the rsync \ntests; they're broken by $(pwd) including whitespace, and haven't been \nfixed yet.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"107487","messageId":"alpine.DEB.1.00.0903091828280.6358@intel-tinevez-2-302","threadId":"18218","inReplyTo":"alpine.LNX.1.00.0903091315440.19665@iabervon.org","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T17:29:03Z","receivedAt":"2009-03-09T17:29:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 9 Mar 2009, Daniel Barkalow wrote:\n\n> On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> \n> > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > \n> > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > \n> > > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > > > \n> > > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > > > \n> > > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > > > > > \n> > > > > > > It doesn't convert http-push or the rsync transports, largely \n> > > > > > > because I don't have test setups for rsync or webdav to make sure \n> > > > > > > that they're still working.\n> > > > > > \n> > > > > > $ ls t/*http-push*\n> > > > > > t/t5540-http-push.sh\n> > > > > > \n> > > > > > $ git grep -n test.*rsync t/\n> > > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > > > > > \n> > > > > > It should be just a matter of installing an apache and rsync.\n> > > > > \n> > > > > And configuring them suitably, yes. That's the part I haven't previously \n> > > > > done.\n> > > > \n> > > > If you have to configure apache (or rsync) for the test to run properly, \n> > > > we have a serious bug in our test suite.  Please share the output in that \n> > > > case.\n> > > \n> > > rsync: failed to connect to 127.0.0.1: Connection refused (111)\n> > > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]\n> > > fatal: Could not run rsync to get refs\n> > > \n> > > I mean, I won't need to do anything really special in the configuration, \n> > > but I do need to have rsyncd running giving access to that directory \n> > > without any funny mapping on localhost.\n> > \n> > That is my mistake, I guess.  I tried to be lazy and not change \n> > transport.c so that it groks \"rsync:$(pwd)\" style paths.\n> \n> Oh, I think it's probably not worth allowing rsync:$(pwd) (particularly \n> since rsync itself seems not to let you say \"rsync:\" for local paths). \n\nThis contradicts that:\n\n> I'll set something up to run rsyncd with an appropriate config, like the \n> lib-httpd stuff. Oh, and it looks like nobody actually runs the rsync \n> tests; they're broken by $(pwd) including whitespace, and haven't been \n> fixed yet.\n\nIf we would support local rsync paths, testing it would be easy.\n\nCiao,\nDscho\n"},{"id":"107489","messageId":"alpine.LNX.1.00.0903091331290.19665@iabervon.org","threadId":"18218","inReplyTo":"alpine.DEB.1.00.0903091828280.6358@intel-tinevez-2-302","subject":"Re: [PATCH 0/2] Move push logic to transport.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-09T18:12:51Z","receivedAt":"2009-03-09T18:12:51Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> \n> > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > \n> > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > > \n> > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > > \n> > > > > On Mon, 9 Mar 2009, Daniel Barkalow wrote:\n> > > > > \n> > > > > > On Mon, 9 Mar 2009, Johannes Schindelin wrote:\n> > > > > > \n> > > > > > > On Sun, 8 Mar 2009, Daniel Barkalow wrote:\n> > > > > > > \n> > > > > > > > It doesn't convert http-push or the rsync transports, largely \n> > > > > > > > because I don't have test setups for rsync or webdav to make sure \n> > > > > > > > that they're still working.\n> > > > > > > \n> > > > > > > $ ls t/*http-push*\n> > > > > > > t/t5540-http-push.sh\n> > > > > > > \n> > > > > > > $ git grep -n test.*rsync t/\n> > > > > > > t/t5510-fetch.sh:195:test_expect_success 'fetch via rsync' '\n> > > > > > > t/t5510-fetch.sh:206:test_expect_success 'push via rsync' '\n> > > > > > > t/t5510-fetch.sh:217:test_expect_success 'push via rsync' '\n> > > > > > > \n> > > > > > > It should be just a matter of installing an apache and rsync.\n> > > > > > \n> > > > > > And configuring them suitably, yes. That's the part I haven't previously \n> > > > > > done.\n> > > > > \n> > > > > If you have to configure apache (or rsync) for the test to run properly, \n> > > > > we have a serious bug in our test suite.  Please share the output in that \n> > > > > case.\n> > > > \n> > > > rsync: failed to connect to 127.0.0.1: Connection refused (111)\n> > > > rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]\n> > > > fatal: Could not run rsync to get refs\n> > > > \n> > > > I mean, I won't need to do anything really special in the configuration, \n> > > > but I do need to have rsyncd running giving access to that directory \n> > > > without any funny mapping on localhost.\n> > > \n> > > That is my mistake, I guess.  I tried to be lazy and not change \n> > > transport.c so that it groks \"rsync:$(pwd)\" style paths.\n> > \n> > Oh, I think it's probably not worth allowing rsync:$(pwd) (particularly \n> > since rsync itself seems not to let you say \"rsync:\" for local paths). \n> \n> This contradicts that:\n> \n> > I'll set something up to run rsyncd with an appropriate config, like the \n> > lib-httpd stuff. Oh, and it looks like nobody actually runs the rsync \n> > tests; they're broken by $(pwd) including whitespace, and haven't been \n> > fixed yet.\n> \n> If we would support local rsync paths, testing it would be easy.\n\nOk, I think having transport_get strip off the \"rsync:\" would make it work \nwith the rest of the functions unchanged, which would in turn mean that \nthe tests would be a pretty reasonable approximation of the real-world \ncode.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"107493","messageId":"e09cc21658a941d8668be0d44c1d1fee503de3ed.1236624246u.git.johannes.schindelin@gmx.de","threadId":"18218","inReplyTo":"cover.1236624246u.git.johannes.schindelin@gmx.de","subject":"[PATCH] rsync transport: allow local paths, and fix tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-09T18:44:55Z","receivedAt":"2009-03-09T18:44:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Earlier, the rsync tests were disabled by default, as they needed a\nrunning rsyncd daemon.  This was only due to the limitation that our\nrsync transport only allowed full URLs of the form\n\n\trsync://<host>/<path>\n\nRelaxing the URLs to allow\n\n\trsync:<path>\n\npermitted the change in the tests to run whenever rsync is available,\nwithout requiring a fully configured and running rsyncd.\n\nWhile at it, the tests were fixed so that they run in directories with a \nspace in their name.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t5510-fetch.sh |   39 ++++++++++++++++++++-------------------\n transport.c      |   23 +++++++++++++++--------\n 2 files changed, 35 insertions(+), 27 deletions(-)\n\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 9e679b4..bee3424 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -191,38 +191,39 @@ test_expect_success 'bundle should be able to create a full history' '\n \n '\n \n-test \"$TEST_RSYNC\" && {\n+! rsync --help > /dev/null 2> /dev/null &&\n+say 'Skipping rsync tests because rsync was not found' || {\n test_expect_success 'fetch via rsync' '\n \tgit pack-refs &&\n \tmkdir rsynced &&\n-\tcd rsynced &&\n-\tgit init &&\n-\tgit fetch rsync://127.0.0.1$(pwd)/../.git master:refs/heads/master &&\n-\tgit gc --prune &&\n-\ttest $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n-\tgit fsck --full\n+\t(cd rsynced &&\n+\t git init --bare &&\n+\t git fetch \"rsync:$(pwd)/../.git\" master:refs/heads/master &&\n+\t git gc --prune &&\n+\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n+\t git fsck --full)\n '\n \n test_expect_success 'push via rsync' '\n-\tmkdir ../rsynced2 &&\n-\t(cd ../rsynced2 &&\n+\tmkdir rsynced2 &&\n+\t(cd rsynced2 &&\n \t git init) &&\n-\tgit push rsync://127.0.0.1$(pwd)/../rsynced2/.git master &&\n-\tcd ../rsynced2 &&\n-\tgit gc --prune &&\n-\ttest $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n-\tgit fsck --full\n+\t(cd rsynced &&\n+\t git push \"rsync:$(pwd)/../rsynced2/.git\" master) &&\n+\t(cd rsynced2 &&\n+\t git gc --prune &&\n+\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n+\t git fsck --full)\n '\n \n test_expect_success 'push via rsync' '\n-\tcd .. &&\n \tmkdir rsynced3 &&\n \t(cd rsynced3 &&\n \t git init) &&\n-\tgit push --all rsync://127.0.0.1$(pwd)/rsynced3/.git &&\n-\tcd rsynced3 &&\n-\ttest $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n-\tgit fsck --full\n+\tgit push --all \"rsync:$(pwd)/rsynced3/.git\" &&\n+\t(cd rsynced3 &&\n+\t test $(git rev-parse master) = $(cd .. && git rev-parse master) &&\n+\t git fsck --full)\n '\n }\n \ndiff --git a/transport.c b/transport.c\nindex 7bc5a55..3015ed1 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -138,6 +138,11 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)\n \t}\n }\n \n+static const char *rsync_url(const char *url)\n+{\n+\treturn prefixcmp(url, \"rsync://\") ? skip_prefix(url, \"rsync:\") : url;\n+}\n+\n static struct ref *get_refs_via_rsync(struct transport *transport)\n {\n \tstruct strbuf buf = STRBUF_INIT, temp_dir = STRBUF_INIT;\n@@ -153,7 +158,7 @@ static struct ref *get_refs_via_rsync(struct transport *transport)\n \t\tdie (\"Could not make temporary directory\");\n \ttemp_dir_len = temp_dir.len;\n \n-\tstrbuf_addstr(&buf, transport->url);\n+\tstrbuf_addstr(&buf, rsync_url(transport->url));\n \tstrbuf_addstr(&buf, \"/refs\");\n \n \tmemset(&rsync, 0, sizeof(rsync));\n@@ -169,7 +174,7 @@ static struct ref *get_refs_via_rsync(struct transport *transport)\n \t\tdie (\"Could not run rsync to get refs\");\n \n \tstrbuf_reset(&buf);\n-\tstrbuf_addstr(&buf, transport->url);\n+\tstrbuf_addstr(&buf, rsync_url(transport->url));\n \tstrbuf_addstr(&buf, \"/packed-refs\");\n \n \targs[2] = buf.buf;\n@@ -206,7 +211,7 @@ static int fetch_objs_via_rsync(struct transport *transport,\n \tconst char *args[8];\n \tint result;\n \n-\tstrbuf_addstr(&buf, transport->url);\n+\tstrbuf_addstr(&buf, rsync_url(transport->url));\n \tstrbuf_addstr(&buf, \"/objects/\");\n \n \tmemset(&rsync, 0, sizeof(rsync));\n@@ -285,7 +290,7 @@ static int rsync_transport_push(struct transport *transport,\n \n \t/* first push the objects */\n \n-\tstrbuf_addstr(&buf, transport->url);\n+\tstrbuf_addstr(&buf, rsync_url(transport->url));\n \tstrbuf_addch(&buf, '/');\n \n \tmemset(&rsync, 0, sizeof(rsync));\n@@ -306,7 +311,8 @@ static int rsync_transport_push(struct transport *transport,\n \targs[i++] = NULL;\n \n \tif (run_command(&rsync))\n-\t\treturn error(\"Could not push objects to %s\", transport->url);\n+\t\treturn error(\"Could not push objects to %s\",\n+\t\t\t\trsync_url(transport->url));\n \n \t/* copy the refs to the temporary directory; they could be packed. */\n \n@@ -327,10 +333,11 @@ static int rsync_transport_push(struct transport *transport,\n \tif (!(flags & TRANSPORT_PUSH_FORCE))\n \t\targs[i++] = \"--ignore-existing\";\n \targs[i++] = temp_dir.buf;\n-\targs[i++] = transport->url;\n+\targs[i++] = rsync_url(transport->url);\n \targs[i++] = NULL;\n \tif (run_command(&rsync))\n-\t\tresult = error(\"Could not push to %s\", transport->url);\n+\t\tresult = error(\"Could not push to %s\",\n+\t\t\t\trsync_url(transport->url));\n \n \tif (remove_dir_recursively(&temp_dir, 0))\n \t\twarning (\"Could not remove temporary directory %s.\",\n@@ -705,7 +712,7 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \tret->remote = remote;\n \tret->url = url;\n \n-\tif (!prefixcmp(url, \"rsync://\")) {\n+\tif (!prefixcmp(url, \"rsync:\")) {\n \t\tret->get_refs_list = get_refs_via_rsync;\n \t\tret->fetch = fetch_objs_via_rsync;\n \t\tret->push = rsync_transport_push;\n-- \n1.6.2.363.g9793e\n"}]}