{"thread":{"id":"12175","subject":"[PATCH] http-push: Fix error message for push <remote> :<branch>","startedAt":"2008-02-18T13:07:26Z","lastAt":"2008-02-27T22:24:00Z","messageCount":27,"participants":["Clemens Buchacher","Johannes Schindelin","Mike Hommey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69136","messageId":"20080218130726.GA26854@localhost","threadId":"12175","inReplyTo":null,"subject":"[PATCH] http-push: Fix error message for push <remote> :<branch>","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-18T13:07:26Z","receivedAt":"2008-02-18T13:07:26Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"git http-push <remote> :<branch> currently fails with the error message\n\"cannot happen anymore\". Print a more useful error message instead.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nWe should actually support this feature, of course. Unfortunately, a lot has\nchanged since the version of send-pack which http-push is based on\n(v1.2.4-398-gaa1dbc9). I think http-push should be updated to reflect these\nchanges at a larger scope. Is there any work going on in this direction?\n\n http-push.c |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex f9b77d6..8de091f 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2311,6 +2311,15 @@ int main(int argc, char **argv)\n \n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n+\n+\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n+\t\t\terror(\"Deleting remote branches via :<branch> is not \"\n+\t\t\t\t\"currently supported by http-push. Use git \"\n+\t\t\t\t\"http-push -d <remote-url> <branch> instead.\");\n+\t\t\trc = -2;\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tif (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {\n \t\t\tif (push_verbosely || 1)\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n-- \n1.5.4.2.183.g1ae81\n"},{"id":"69145","messageId":"alpine.LSU.1.00.0802181339470.30505@racer.site","threadId":"12175","inReplyTo":"20080218130726.GA26854@localhost","subject":"Re: [PATCH] http-push: Fix error message for push <remote> :<branch>","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-18T13:45:08Z","receivedAt":"2008-02-18T13:45:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 18 Feb 2008, Clemens Buchacher wrote:\n\n> git http-push <remote> :<branch> currently fails with the error message \n> \"cannot happen anymore\". Print a more useful error message instead.\n> \n> Signed-off-by: Clemens Buchacher <drizzd@aon.at>\n> ---\n> \n> We should actually support this feature, of course. Unfortunately, a lot \n> has changed since the version of send-pack which http-push is based on \n> (v1.2.4-398-gaa1dbc9). I think http-push should be updated to reflect \n> these changes at a larger scope. Is there any work going on in this \n> direction?\n\nNope.  You are the ideal candidate to start, though.\n\n> diff --git a/http-push.c b/http-push.c\n> index f9b77d6..8de091f 100644\n> --- a/http-push.c\n> +++ b/http-push.c\n> @@ -2311,6 +2311,15 @@ int main(int argc, char **argv)\n>  \n>  \t\tif (!ref->peer_ref)\n>  \t\t\tcontinue;\n> +\n> +\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n> +\t\t\terror(\"Deleting remote branches via :<branch> is not \"\n> +\t\t\t\t\"currently supported by http-push. Use git \"\n> +\t\t\t\t\"http-push -d <remote-url> <branch> instead.\");\n> +\t\t\trc = -2;\n> +\t\t\tcontinue;\n> +\t\t}\n> +\n\nYou forgot to remove the now-obsolete warning...\n\nBesides, why don't you just try to imitate the code for \"-d\"?  It says\n\n        if (delete_branch) {\n                if (delete_remote_branch(refspec[0], force_delete) == -1)\n                        fprintf(stderr, \"Unable to delete remote branch %s\\n\",\n                                refspec[0]);\n                goto cleanup;\n        }\n\nSo I think something like this should work, at the same place you added \nyour code:\n\n\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n\t\t\tif (delete_remote_branch(ref->peer_ref->name,\n\t\t\t\t\tforce_delete || ref->force) == -1) {\n\t\t\t\terror(\"Could not remove %s\",\n\t\t\t\t\tref->peer_ref->name);\n\t\t\t\trc = -4;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\nCare to try that?\n\nCiao,\nDscho\n"},{"id":"69161","messageId":"20080218155546.GA8934@localhost","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802181339470.30505@racer.site","subject":"[PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-18T15:55:46Z","receivedAt":"2008-02-18T15:55:46Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"This mirrors current ssh/git push syntax.\n---\nOn Mon, Feb 18, 2008 at 01:45:08PM +0000, Johannes Schindelin wrote:\n> Besides, why don't you just try to imitate the code for \"-d\"?\n\nI was hesitant to implement something that will only partially mirror the\nbehavior of git/ssh push. For example, git/ssh push will also update the\ncorresponding remote-tracking branches and give a status report\n(new/deleted/updated/rejected etc.) at the end.\n\nAfter playing with the code a little I feel more confident that the other\nissues with http-push are unrelated to this patch and the differences between\ngit/ssh push and http-push are acceptable for now.\n\n> So I think something like this should work, at the same place you added \n> your code:\n> \n> \t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n> \t\t\tif (delete_remote_branch(ref->peer_ref->name,\n> \t\t\t\t\tforce_delete || ref->force) == -1) {\n> \t\t\t\terror(\"Could not remove %s\",\n> \t\t\t\t\tref->peer_ref->name);\n> \t\t\t\trc = -4;\n> \t\t\t}\n> \t\t\tcontinue;\n> \t\t}\n\nIndeed. According to the rules listed in builtin-send-pack.c:442, I changed\n(force_delete || ref->force) to 1.\n\nClemens\n\n http-push.c |   18 +++++++++++++-----\n 1 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex f9b77d6..e98c52f 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2138,6 +2138,8 @@ static int delete_remote_branch(char *pattern, int force)\n \n \t/* Send delete request */\n \tfprintf(stderr, \"Removing remote branch '%s'\\n\", remote_ref->name);\n+\tif (dry_run)\n+\t\treturn 0;\n \turl = xmalloc(strlen(remote->url) + strlen(remote_ref->name) + 1);\n \tsprintf(url, \"%s%s\", remote->url, remote_ref->name);\n \tslot = get_active_slot();\n@@ -2311,6 +2313,17 @@ int main(int argc, char **argv)\n \n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n+\n+\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n+\t\t\tif (delete_remote_branch(ref->name, 1) == -1) {\n+\t\t\t\terror(\"Could not remove %s\",\n+\t\t\t\t\tref->peer_ref->name);\n+\t\t\t\trc = -4;\n+\t\t\t}\n+\t\t\tnew_refs++;\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tif (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {\n \t\t\tif (push_verbosely || 1)\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n@@ -2342,11 +2355,6 @@ int main(int argc, char **argv)\n \t\t\t}\n \t\t}\n \t\thashcpy(ref->new_sha1, ref->peer_ref->new_sha1);\n-\t\tif (is_zero_sha1(ref->new_sha1)) {\n-\t\t\terror(\"cannot happen anymore\");\n-\t\t\trc = -3;\n-\t\t\tcontinue;\n-\t\t}\n \t\tnew_refs++;\n \t\tstrcpy(old_hex, sha1_to_hex(ref->old_sha1));\n \t\tnew_hex = sha1_to_hex(ref->new_sha1);\n-- \n1.5.4.2.183.g69d3\n"},{"id":"69170","messageId":"20080218164423.GA8832@localhost","threadId":"12175","inReplyTo":"20080218155546.GA8934@localhost","subject":"[PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-18T16:44:23Z","receivedAt":"2008-02-18T16:44:23Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"This mirrors current ssh/git push syntax.\n---\n\nThe previous patch gives the wrong branch name in the failure message.\n\nClemens\n\n http-push.c |   17 ++++++++++++-----\n 1 files changed, 12 insertions(+), 5 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex f9b77d6..2c928fc 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2138,6 +2138,8 @@ static int delete_remote_branch(char *pattern, int force)\n \n \t/* Send delete request */\n \tfprintf(stderr, \"Removing remote branch '%s'\\n\", remote_ref->name);\n+\tif (dry_run)\n+\t\treturn 0;\n \turl = xmalloc(strlen(remote->url) + strlen(remote_ref->name) + 1);\n \tsprintf(url, \"%s%s\", remote->url, remote_ref->name);\n \tslot = get_active_slot();\n@@ -2311,6 +2313,16 @@ int main(int argc, char **argv)\n \n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n+\n+\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n+\t\t\tif (delete_remote_branch(ref->name, 1) == -1) {\n+\t\t\t\terror(\"Could not remove %s\", ref->name);\n+\t\t\t\trc = -4;\n+\t\t\t}\n+\t\t\tnew_refs++;\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tif (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {\n \t\t\tif (push_verbosely || 1)\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n@@ -2342,11 +2354,6 @@ int main(int argc, char **argv)\n \t\t\t}\n \t\t}\n \t\thashcpy(ref->new_sha1, ref->peer_ref->new_sha1);\n-\t\tif (is_zero_sha1(ref->new_sha1)) {\n-\t\t\terror(\"cannot happen anymore\");\n-\t\t\trc = -3;\n-\t\t\tcontinue;\n-\t\t}\n \t\tnew_refs++;\n \t\tstrcpy(old_hex, sha1_to_hex(ref->old_sha1));\n \t\tnew_hex = sha1_to_hex(ref->new_sha1);\n-- \n1.5.4.2.183.g69d3\n"},{"id":"69174","messageId":"alpine.LSU.1.00.0802181733400.30505@racer.site","threadId":"12175","inReplyTo":"20080218155546.GA8934@localhost","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-18T17:34:45Z","receivedAt":"2008-02-18T17:34:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 18 Feb 2008, Clemens Buchacher wrote:\n\n> diff --git a/http-push.c b/http-push.c\n> index f9b77d6..e98c52f 100644\n> --- a/http-push.c\n> +++ b/http-push.c\n> @@ -2138,6 +2138,8 @@ static int delete_remote_branch(char *pattern, int force)\n>  \n>  \t/* Send delete request */\n>  \tfprintf(stderr, \"Removing remote branch '%s'\\n\", remote_ref->name);\n> +\tif (dry_run)\n> +\t\treturn 0;\n\nGood catch.\n\nThanks for the patch, I think it good.  Now, if we only had automated \ntests... ;-)\n\nCiao,\nDscho\n"},{"id":"69175","messageId":"alpine.LSU.1.00.0802181735230.30505@racer.site","threadId":"12175","inReplyTo":"20080218164423.GA8832@localhost","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-18T17:35:39Z","receivedAt":"2008-02-18T17:35:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 18 Feb 2008, Clemens Buchacher wrote:\n\n> This mirrors current ssh/git push syntax.\n> ---\n> \n> The previous patch gives the wrong branch name in the failure message.\n\nOh?  ref->peer_ref is not the remote side?\n\nCiao,\nDscho\n"},{"id":"69253","messageId":"20080219125840.GA14049@localhost","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802181733400.30505@racer.site","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-19T12:58:40Z","receivedAt":"2008-02-19T12:58:40Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Hi,\n\nOn Mon, Feb 18, 2008 at 05:34:45PM +0000, Johannes Schindelin wrote:\n> Thanks for the patch, I think it good.  Now, if we only had automated \n> tests... ;-)\n\nThank you. Implementing a test should be fairly difficult, since we need at\nleast a WebDAV capable webserver, right? Do you having something in mind?\n\nAnd yes, 'peer' apparently refers to the local end in this case.\n\nClemens\n"},{"id":"69257","messageId":"alpine.LSU.1.00.0802191313290.30505@racer.site","threadId":"12175","inReplyTo":"20080219125840.GA14049@localhost","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-19T13:17:24Z","receivedAt":"2008-02-19T13:17:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 19 Feb 2008, Clemens Buchacher wrote:\n\n> On Mon, Feb 18, 2008 at 05:34:45PM +0000, Johannes Schindelin wrote:\n>\n> > Thanks for the patch, I think it good.  Now, if we only had automated \n> > tests... ;-)\n> \n> Thank you. Implementing a test should be fairly difficult, since we need \n> at least a WebDAV capable webserver, right? Do you having something in \n> mind?\n\nActually, thinking about it again, it should not be _that_ difficult.  We \nwould need to ship a httpd.conf.in, pick a port (maybe 8111, because that \nis already used in t5703-daemon.sh), generate httpd.conf and then start \nApache with that.\n\nIf Apache does not want to start, skip this test.  (This might happen due \nto Apache not being installed, or the DAV modules not being installed, or \nApache not finding them, or...)\n\nAnd of course, we would want to have something like NO_SVN_TESTS (maybe \nNO_APACHE_TESTS) to be able to skip the tests, since they are pretty \nexpensive (starting Apache and all).\n\n> And yes, 'peer' apparently refers to the local end in this case.\n\nThanks for the clarification.\n\nCiao,\nDscho\n"},{"id":"69258","messageId":"20080219132410.GA6553@glandium.org","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802191313290.30505@racer.site","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-19T13:24:11Z","receivedAt":"2008-02-19T13:24:11Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Tue, Feb 19, 2008 at 01:17:24PM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n> \n> On Tue, 19 Feb 2008, Clemens Buchacher wrote:\n> \n> > On Mon, Feb 18, 2008 at 05:34:45PM +0000, Johannes Schindelin wrote:\n> >\n> > > Thanks for the patch, I think it good.  Now, if we only had automated \n> > > tests... ;-)\n> > \n> > Thank you. Implementing a test should be fairly difficult, since we need \n> > at least a WebDAV capable webserver, right? Do you having something in \n> > mind?\n> \n> Actually, thinking about it again, it should not be _that_ difficult.  We \n> would need to ship a httpd.conf.in, pick a port (maybe 8111, because that \n> is already used in t5703-daemon.sh), generate httpd.conf and then start \n> Apache with that.\n> \n> If Apache does not want to start, skip this test.  (This might happen due \n> to Apache not being installed, or the DAV modules not being installed, or \n> Apache not finding them, or...)\n\nExcept that means coping with the fact that modules are probably not\ninstalled in the same place on all distros, or can have been built in\napache instead of being DSOs, etc.\nThe server itself doesn't even have the same name across distros (httpd vs.\napache vs. apache2)\n\nMike\n"},{"id":"69259","messageId":"alpine.LSU.1.00.0802191328040.30505@racer.site","threadId":"12175","inReplyTo":"20080219132410.GA6553@glandium.org","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-19T13:31:31Z","receivedAt":"2008-02-19T13:31:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 19 Feb 2008, Mike Hommey wrote:\n\n> On Tue, Feb 19, 2008 at 01:17:24PM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> > On Tue, 19 Feb 2008, Clemens Buchacher wrote:\n> > \n> > > On Mon, Feb 18, 2008 at 05:34:45PM +0000, Johannes Schindelin wrote:\n> > >\n> > > > Thanks for the patch, I think it good.  Now, if we only had \n> > > > automated tests... ;-)\n> > > \n> > > Thank you. Implementing a test should be fairly difficult, since we \n> > > need at least a WebDAV capable webserver, right? Do you having \n> > > something in mind?\n> > \n> > Actually, thinking about it again, it should not be _that_ difficult.  \n> > We would need to ship a httpd.conf.in, pick a port (maybe 8111, \n> > because that is already used in t5703-daemon.sh), generate httpd.conf \n> > and then start Apache with that.\n> > \n> > If Apache does not want to start, skip this test.  (This might happen \n> > due to Apache not being installed, or the DAV modules not being \n> > installed, or Apache not finding them, or...)\n> \n> Except that means coping with the fact that modules are probably not \n> installed in the same place on all distros, or can have been built in \n> apache instead of being DSOs, etc. The server itself doesn't even have \n> the same name across distros (httpd vs. apache vs. apache2)\n\nI think this would not be too much of a hassle.  These days, an Apache2 is \ninstalled on many machines, and it is better to have tests, than to have \nno tests, even if they are not exercised everywhere, right?\n\nBesides, for those machines that do not have Apache installed (such as \nMinGW based setups), we can always add yet another environment variable, \nsay \"HTTP_PUSH_TEST_URL\" to tell the test that there is already a \nweb server set up at that URL, ready to be used.\n\nCiao,\nDscho\n"},{"id":"69316","messageId":"7v4pc4iq94.fsf@gitster.siamese.dyndns.org","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802191328040.30505@racer.site","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-19T21:35:19Z","receivedAt":"2008-02-19T21:35:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I think this would not be too much of a hassle.  These days, an Apache2 is \n> installed on many machines, and it is better to have tests, than to have \n> no tests, even if they are not exercised everywhere, right?\n\nI think a sensible guideline would be:\n\n - the core tools are tested by default everywhere;\n\n - i18n bits and foreign SCM interface are tested by default,\n   but should allow opting-out;\n\n - networking test that needs to open listening ports should be\n   off by default but should allow opting-in.\n"},{"id":"69327","messageId":"alpine.LSU.1.00.0802192224370.7826@racer.site","threadId":"12175","inReplyTo":"7v4pc4iq94.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] http-push: push <remote> :<branch> deletes remote branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-19T22:25:10Z","receivedAt":"2008-02-19T22:25:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 19 Feb 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > I think this would not be too much of a hassle.  These days, an \n> > Apache2 is installed on many machines, and it is better to have tests, \n> > than to have no tests, even if they are not exercised everywhere, \n> > right?\n> \n> I think a sensible guideline would be:\n> \n>  - the core tools are tested by default everywhere;\n> \n>  - i18n bits and foreign SCM interface are tested by default,\n>    but should allow opting-out;\n> \n>  - networking test that needs to open listening ports should be\n>    off by default but should allow opting-in.\n\nFair enough.  Although there is nothing there to debate about, yet.\n\nCiao,\nDscho\n"},{"id":"69712","messageId":"20080223212843.GA30054@localhost","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802181733400.30505@racer.site","subject":"[PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-23T21:28:44Z","receivedAt":"2008-02-23T21:28:44Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"These tests require a webserver. The executable path and listening port\nare configured using the environment variables\n\nHTTPD_PATH (default: /usr/sbin/apache2) and\nHTTPD_PORT (default: 8111),\n\nrespectively.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n t/t5540-http-push.sh |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 97 insertions(+), 0 deletions(-)\n create mode 100644 t/t5540-http-push.sh\n\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nnew file mode 100644\nindex 0000000..60210ff\n--- /dev/null\n+++ b/t/t5540-http-push.sh\n@@ -0,0 +1,97 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+test_description='test http-push\n+\n+This test runs various sanity checks on http-push.'\n+\n+. ./test-lib.sh\n+\n+HTTPD_PATH=${HTTPD_PATH-'/usr/sbin/apache2'}\n+HTTPD_PORT=${HTTPD_PORT-'8111'}\n+\n+if ! test -x \"$HTTPD_PATH\"\n+then\n+        test_expect_success 'skipping http-push tests, no suitable webserver' :\n+        test_done\n+        exit\n+fi\n+\n+TRASH_PATH=$PWD\n+\n+start_httpd() {\n+\tcat > \"$TRASH_PATH/httpd.conf\" <<EOF\n+ServerRoot \"$TRASH_PATH\"\n+PidFile \"$TRASH_PATH/httpd.pid\"\n+DocumentRoot \"$TRASH_PATH\"\n+ErrorLog \"$TRASH_PATH/error.log\"\n+Listen 127.0.0.1:$HTTPD_PORT\n+LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so\n+LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so\n+DAVLockDB DAVLock\n+<Location />\n+\tDav on\n+</Location>\n+EOF\n+\n+\t\"$HTTPD_PATH\" -f \"$TRASH_PATH\"/httpd.conf -k start\n+}\n+\n+stop_httpd() {\n+\t\"$HTTPD_PATH\" -f \"$TRASH_PATH\"/httpd.conf -k stop\n+}\n+\n+test_expect_success 'setup webserver' '\n+\tstart_httpd\n+'\n+\n+test_expect_success 'setup remote repository' '\n+\tcd \"$TRASH_PATH\" &&\n+\tmkdir test_repo &&\n+\tcd test_repo &&\n+\tgit init &&\n+\t: >path1 &&\n+\tgit add path1 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tcd - &&\n+\tgit clone --bare test_repo test_repo.git &&\n+\tcd test_repo.git &&\n+\tgit --bare update-server-info &&\n+\tchmod +x hooks/post-update\n+'\n+\t\n+test_expect_success 'clone remote repository' '\n+\tcd \"$TRASH_PATH\" &&\n+\tgit clone http://127.0.0.1:$HTTPD_PORT/test_repo.git test_repo_clone\n+'\n+\n+test_expect_success 'push to remote repository' '\n+\tcd \"$TRASH_PATH\"/test_repo_clone &&\n+\t: >path2 &&\n+\tgit add path2 &&\n+\ttest_tick &&\n+\tgit commit -m path2 &&\n+\tgit push\n+'\n+\n+test_expect_success 'create and delete remote branch' '\n+\tcd \"$TRASH_PATH\"/test_repo_clone &&\n+\tgit checkout -b dev &&\n+\t: >path3 &&\n+\tgit add path3 &&\n+\ttest_tick &&\n+\tgit commit -m dev &&\n+\tgit push origin dev &&\n+\tgit fetch &&\n+\tgit push origin :dev &&\n+\tgit branch -d -r origin/dev &&\n+\tgit fetch &&\n+\t! git show-ref --verify refs/remotes/origin/dev\n+'\n+\n+stop_httpd\n+\n+test_done\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"69771","messageId":"20080224085830.GD13416@glandium.org","threadId":"12175","inReplyTo":"20080223212843.GA30054@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-24T08:58:30Z","receivedAt":"2008-02-24T08:58:30Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Sat, Feb 23, 2008 at 10:28:44PM +0100, Clemens Buchacher wrote:\n> These tests require a webserver. The executable path and listening port\n> are configured using the environment variables\n> \n> HTTPD_PATH (default: /usr/sbin/apache2) and\n> HTTPD_PORT (default: 8111),\n(...)\n> +LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so\n> +LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so\n\nYou'd need something for these paths too.\n\nIt would be nice if the httpd setup could be done in another file so\nthat other tests could use it. Also, an https setup would be nice ;)\n\nMike\n"},{"id":"69805","messageId":"20080224180340.GA11515@localhost","threadId":"12175","inReplyTo":"20080224085830.GD13416@glandium.org","subject":"[PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-24T18:03:40Z","receivedAt":"2008-02-24T18:03:40Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"http-push tests require a web server with WebDAV support.\n\nThis commit introduces a HTTPD test library, which can be configured using\nthe following environment variables.\n\nLIB_HTTPD_PATH\tweb server path\nLIB_HTTPD_PORT\tlistening port\nLIB_HTTPD_DAV\tenable DAV\nLIB_HTTPD_SVN\tenable SVN\nLIB_HTTPD_SSL\tenable SSL\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nOn Sun, Feb 24, 2008 at 09:58:30AM +0100, Mike Hommey wrote:\n> > +LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so\n> > +LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so\n> \n> You'd need something for these paths too.\n\nIndeed. If Apache or the DAV modules are not found, the test is now skipped. If\nApache is older than version 2, the test is skipped as well. I had some\nproblems with WebDAV \"lock tokens\" and couldn't get http-push to work. In\nprinciple, however, lib-http.sh also works with Apache version 1.3.\n\nIf LIB_HTTPD_PATH points to an executable, but not to an Apache web server, the\ntest fails with an error.\n\n> It would be nice if the httpd setup could be done in another file so\n> that other tests could use it. Also, an https setup would be nice ;)\n\nGood idea.\n\nI also added SVN support. I simply tried to mimic the code from lib-git-svn.sh.\nIt should be straightforward to integrate lib-httpd.sh into lib-git-svn.sh now.\n\nRegards,\nClemens\n\n t/lib-httpd.sh       |  181 ++++++++++++++++++++++++++++++++++++++++++++++++++\n t/t5540-http-push.sh |   83 +++++++++++++++++++++++\n 2 files changed, 264 insertions(+), 0 deletions(-)\n create mode 100644 t/lib-httpd.sh\n create mode 100644 t/t5540-http-push.sh\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nnew file mode 100644\nindex 0000000..7fc090e\n--- /dev/null\n+++ b/t/lib-httpd.sh\n@@ -0,0 +1,181 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+LIB_HTTPD_ROOT_PATH=${LIB_HTTPD_ROOT_PATH-\"$PWD\"}\n+LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}\n+\n+if test -x \"$LIB_HTTPD_PATH\"; then\n+\n+HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \\\n+\tsed -n 's/^Server version: Apache\\/\\([0-9\\.]*\\).*$/\\1/p'`\n+HTTPD_VERSION_MAJOR=$((`echo $HTTPD_VERSION | sed 's/\\..*//'`))\n+HTTPD_VERSION_MINOR=\\\n+$((`echo $HTTPD_VERSION | sed 's/^[0-9]*\\.//' | sed 's/\\..*//'`))\n+\n+if test -n \"$HTTPD_VERSION\"\n+then\n+\tif test -z \"$LIB_HTTPD_MODULE_PATH\"\n+\tthen\n+\t\tif test $HTTPD_VERSION_MAJOR -ge 2\n+\t\tthen\n+\t\t\tLIB_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\t\telse\n+\t\t\tHTTPD_VERSION_SHORT=$HTTPD_VERSION_MAJOR.$HTTPD_VERSION_MINOR\n+\t\t\tLIB_HTTPD_MODULE_PATH=\"/usr/lib/apache/$HTTPD_VERSION_SHORT\"\n+\t\tfi\n+\tfi\n+else\n+\terror \"Could not identify web server '$LIB_HTTPD_PATH'\"\n+fi\n+\n+fi # test -x \"$LIB_HTTPD_PATH\"\n+\n+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}\n+\n+if test -z \"$LIB_HTTPD_SSL\"\n+then\n+\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\n+else\n+\tHTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT\n+fi\n+\n+conf_init() {\n+\ttest $# -eq 0 ||\n+\terror \"error: not 0 parameters to conf_init\"\n+\n+\t: >\"$LIB_HTTPD_ROOT_PATH/httpd.conf\"\n+}\n+\n+conf_write() {\n+\ttest $# -eq 0 ||\n+\terror \"error: not 0 parameters to conf_write\"\n+\n+\tcat >> \"$LIB_HTTPD_ROOT_PATH/httpd.conf\"\n+}\n+\n+conf_load_module() {\n+\ttest $# -eq 2 ||\n+\terror \"error: not 2 parameters to conf_load_module\"\n+\n+\tif ! test -f $LIB_HTTPD_MODULE_PATH/$2\n+\tthen\n+\t\ttest_expect_success \"Could find $1 at $LIB_HTTPD_MODULE_PATH/$2\" :\n+\t\ttest_done\n+\t\texit\n+\tfi\n+\n+\tconf_write <<EOF\n+LoadModule $1 $LIB_HTTPD_MODULE_PATH/$2\n+EOF\n+}\n+\n+prepare_httpd() {\n+\ttest $# -eq 0 ||\n+\terror \"error: not 0 parameters to prepare_httpd\"\n+\n+\tconf_write <<EOF\n+ServerRoot $LIB_HTTPD_ROOT_PATH\n+PidFile $LIB_HTTPD_ROOT_PATH/httpd.pid\n+DocumentRoot $LIB_HTTPD_ROOT_PATH\n+ErrorLog $LIB_HTTPD_ROOT_PATH/error.log\n+Listen 127.0.0.1:$LIB_HTTPD_PORT\n+EOF\n+\n+\tif test \"$LIB_HTTPD_SSL\" != \"\"\n+\tthen\n+\t\tcat > $LIB_HTTPD_ROOT_PATH/ssl.cnf <<EOF\n+RANDFILE                = $ENV::HOME/.rnd\n+\n+[ req ]\n+default_bits            = 1024\n+distinguished_name      = req_distinguished_name\n+prompt                  = no\n+[ req_distinguished_name ]\n+commonName                      = 127.0.0.1\n+EOF\n+\t\topenssl req \\\n+\t\t\t-config $LIB_HTTPD_ROOT_PATH/ssl.cnf \\\n+\t\t\t-new -x509 -nodes \\\n+\t\t\t-out $LIB_HTTPD_ROOT_PATH/httpd.pem \\\n+\t\t\t-keyout $LIB_HTTPD_ROOT_PATH/httpd.pem\n+\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tconf_load_module ssl_module mod_ssl.so\n+\t\tconf_write <<EOF\n+SSLCertificateFile $LIB_HTTPD_ROOT_PATH/httpd.pem\n+SSLCertificateKeyFile $LIB_HTTPD_ROOT_PATH/httpd.pem\n+SSLRandomSeed startup file:/dev/urandom 512\n+SSLRandomSeed connect file:/dev/urandom 512\n+SSLSessionCache none\n+SSLMutex file:$LIB_HTTPD_ROOT_PATH/ssl_mutex\n+SSLEngine On\n+EOF\n+\tfi\n+\t\t\n+\tif test \"$LIB_HTTPD_DAV\" != \"\" -o \"$LIB_HTTPD_SVN\" != \"\"\n+\tthen\n+\t\tif test $HTTPD_VERSION_MAJOR -ge 2\n+\t\tthen\n+\t\t\tconf_load_module dav_module mod_dav.so\n+\t\telse\n+\t\t\tconf_load_module dav_module libdav.so\n+\t\tfi\n+\n+\t\tif test $HTTPD_VERSION_MAJOR -ge 2\n+\t\tthen\n+\t\t\tconf_load_module dav_fs_module mod_dav_fs.so\n+\t\tfi\n+\n+\t\tconf_write <<EOF\n+DAVLockDB DAVLock\n+<Location />\n+\tDav on\n+</Location>\n+EOF\n+\n+\t\tif test \"$LIB_HTTPD_SVN\" != \"\"\n+\t\tthen\n+\t\t\trawsvnrepo=\"$LIB_HTTPD_ROOT_PATH/svnrepo\"\n+\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n+\n+\t\t\tconf_load_module dav_svn_module mod_dav_svn.so\n+\t\t\tconf_write <<EOF\n+<Location /svn>\n+\tDAV svn\n+\tSVNPath $rawsvnrepo\n+</Location>\n+EOF\n+\t\tfi\n+\tfi\n+}\n+\n+start_httpd() {\n+\ttest $# -eq 0 ||\n+\terror \"error: not 0 parameters to start_httpd\"\n+\n+\tprepare_httpd\n+\n+\tif test $HTTPD_VERSION_MAJOR -ge 2\n+\tthen\n+\t\t\"$LIB_HTTPD_PATH\" -f \"$LIB_HTTPD_ROOT_PATH\"/httpd.conf -k start\n+\telse\n+\t\tstart-stop-daemon --start \\\n+\t\t\t--pidfile \"$LIB_HTTPD_ROOT_PATH/httpd.pid\" \\\n+\t\t\t--exec \"$LIB_HTTPD_PATH\" \\\n+\t\t\t-- -f \"$LIB_HTTPD_ROOT_PATH\"/httpd.conf\n+\tfi\n+}\n+\n+stop_httpd() {\n+\ttest $# -eq 0 ||\n+\terror \"error: not 0 parameters to stop_httpd\"\n+\n+\tif test $HTTPD_VERSION_MAJOR -ge 2\n+\tthen\n+\t\t\"$LIB_HTTPD_PATH\" -f \"$LIB_HTTPD_ROOT_PATH\"/httpd.conf -k stop\n+\telse\n+\t\tstart-stop-daemon --stop \\\n+\t\t\t--pidfile \"$LIB_HTTPD_ROOT_PATH/httpd.pid\"\n+\tfi\n+}\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nnew file mode 100644\nindex 0000000..9706f30\n--- /dev/null\n+++ b/t/t5540-http-push.sh\n@@ -0,0 +1,83 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+test_description='test http-push\n+\n+This test runs various sanity checks on http-push.'\n+\n+. ./test-lib.sh\n+\n+ROOT_PATH=$PWD\n+LIB_HTTPD_ROOT_PATH=$ROOT_PATH\n+LIB_HTTPD_DAV=t\n+\n+. ../lib-httpd.sh\n+\n+if ! test -x \"$LIB_HTTPD_PATH\"\n+then\n+        test_expect_success \"skipping http-push tests, no web server found at $LIB_HTTPD_PATH\" :\n+        test_done\n+        exit\n+fi\n+\n+test_expect_success 'setup web server' '\n+\tstart_httpd\n+'\n+\n+test_expect_success 'setup remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tmkdir test_repo &&\n+\tcd test_repo &&\n+\tgit init &&\n+\t: >path1 &&\n+\tgit add path1 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tcd - &&\n+\tgit clone --bare test_repo test_repo.git &&\n+\tcd test_repo.git &&\n+\tgit --bare update-server-info &&\n+\tchmod +x hooks/post-update\n+'\n+\t\n+test_expect_success 'clone remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tgit clone $HTTPD_URL/test_repo.git test_repo_clone\n+'\n+\n+if ! test -n \"$HTTPD_VERSION\" -a $HTTPD_VERSION_MAJOR -ge 2\n+then\n+\ttest_expect_success \"skipping remaining http-push tests, at least Apache version 2 is required\" :\n+        test_done\n+        exit\n+fi\n+\n+test_expect_success 'push to remote repository' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\t: >path2 &&\n+\tgit add path2 &&\n+\ttest_tick &&\n+\tgit commit -m path2 &&\n+\tgit push\n+'\n+\n+test_expect_success 'create and delete remote branch' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\tgit checkout -b dev &&\n+\t: >path3 &&\n+\tgit add path3 &&\n+\ttest_tick &&\n+\tgit commit -m dev &&\n+\tgit push origin dev &&\n+\tgit fetch &&\n+\tgit push origin :dev &&\n+\tgit branch -d -r origin/dev &&\n+\tgit fetch &&\n+\t! git show-ref --verify refs/remotes/origin/dev\n+'\n+\n+stop_httpd\n+\n+test_done\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"69810","messageId":"20080224184832.GA24240@glandium.org","threadId":"12175","inReplyTo":"20080224180340.GA11515@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-24T18:48:32Z","receivedAt":"2008-02-24T18:48:32Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Sun, Feb 24, 2008 at 07:03:40PM +0100, Clemens Buchacher wrote:\n> http-push tests require a web server with WebDAV support.\n> \n> This commit introduces a HTTPD test library, which can be configured using\n> the following environment variables.\n> \n> LIB_HTTPD_PATH\tweb server path\n> LIB_HTTPD_PORT\tlistening port\n> LIB_HTTPD_DAV\tenable DAV\n> LIB_HTTPD_SVN\tenable SVN\n> LIB_HTTPD_SSL\tenable SSL\n\nI'd add LIB_HTTPD_MODULE_PATH in here ;)\n\nI took a quick but deeper look to your script, and I think it would be\nbetter to have a httpd.conf with proper <IfDefine> directives, and\ntoggle the proper defines on the httpd command line.\n\nNote the ServerRoot is used when paths are relative, so only the\nServerRoot need to be set, and it could be set with the -C argument to\nhttpd, avoiding the need of a .in file. If necessary, modules path could\nbe made relative to the ServerRoot by means of a symlink.\n\nAvoiding to have logs, dav lock, ssl mutex, etc. in the document\nroot would be better, too, but that is nitpicking.\n\nMike\n"},{"id":"69811","messageId":"20080224191455.GA20884@localhost","threadId":"12175","inReplyTo":"20080224184832.GA24240@glandium.org","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-24T19:14:55Z","receivedAt":"2008-02-24T19:14:55Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Hi,\n\nOn Sun, Feb 24, 2008 at 07:48:32PM +0100, Mike Hommey wrote:\n> I took a quick but deeper look to your script, and I think it would be\n> better to have a httpd.conf with proper <IfDefine> directives, and\n> toggle the proper defines on the httpd command line.\n\nI wanted to avoid that because I thought it would make it harder to adapt the\nscript to different web servers. However, the script turned out to be very\napache specific anyways. I'll have a look at those IfDefine's.\n\n> Note the ServerRoot is used when paths are relative, so only the\n> ServerRoot need to be set, and it could be set with the -C argument to\n> httpd, avoiding the need of a .in file. If necessary, modules path could\n> be made relative to the ServerRoot by means of a symlink.\n\nI see.\n\n> Avoiding to have logs, dav lock, ssl mutex, etc. in the document\n> root would be better, too, but that is nitpicking.\n\nTrue. Maybe we should also make a separate working directory for the clones.\n\nClemens\n"},{"id":"69946","messageId":"20080225232820.GA18254@localhost","threadId":"12175","inReplyTo":"20080224184832.GA24240@glandium.org","subject":"[PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-25T23:28:20Z","receivedAt":"2008-02-25T23:28:20Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"http-push tests require a web server with WebDAV support.\n\nThis commit introduces a HTTPD test library, which can be configured using\nthe following environment variables.\n\nLIB_HTTPD_PATH\t\tweb server path\nLIB_HTTPD_MODULE_PATH\tweb server modules path\nLIB_HTTPD_PORT\t\tlistening port\nLIB_HTTPD_DAV\t\tenable DAV\nLIB_HTTPD_SVN\t\tenable SVN\nLIB_HTTPD_SSL\t\tenable SSL\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nOn Sun, Feb 24, 2008 at 07:48:32PM +0100, Mike Hommey wrote:\n> I took a quick but deeper look to your script, and I think it would be\n> better to have a httpd.conf with proper <IfDefine> directives, and\n> toggle the proper defines on the httpd command line.\n\nAlright, here we go.\n\n t/lib-httpd.sh          |   88 +++++++++++++++++++++++++++++++++++++++++++++++\n t/lib-httpd/apache.conf |   34 ++++++++++++++++++\n t/lib-httpd/ssl.cnf     |    8 ++++\n t/t5540-http-push.sh    |   73 +++++++++++++++++++++++++++++++++++++++\n 4 files changed, 203 insertions(+), 0 deletions(-)\n create mode 100644 t/lib-httpd.sh\n create mode 100644 t/lib-httpd/apache.conf\n create mode 100644 t/lib-httpd/ssl.cnf\n create mode 100644 t/t5540-http-push.sh\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nnew file mode 100644\nindex 0000000..2c621c4\n--- /dev/null\n+++ b/t/lib-httpd.sh\n@@ -0,0 +1,88 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}\n+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}\n+\n+TEST_PATH=\"$PWD\"/../lib-httpd\n+HTTPD_ROOT_PATH=\"$PWD\"/httpd\n+HTTPD_DOCUMENT_ROOT_PATH=\"$PWD\"/httpd/www\n+\n+if ! test -x \"$LIB_HTTPD_PATH\"\n+then\n+        say_color \"\" \"skipping test, no web server found at $LIB_HTTPD_PATH\"\n+        test_done\n+        exit\n+fi\n+\n+HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \\\n+\tsed -n 's/^Server version: Apache\\/\\([0-9]*\\)\\..*$/\\1/p; q'`\n+\n+if test -n \"$HTTPD_VERSION\"\n+then\n+\tif test -z \"$LIB_HTTPD_MODULE_PATH\"\n+\tthen\n+\t\tif ! test $HTTPD_VERSION -ge 2\n+\t\tthen\n+\t\t\tsay_color \"\" \"skipping test, at least Apache version 2 is required\"\n+\t\t\ttest_done\n+\t\t\texit\n+\t\tfi\n+\n+\t\tLIB_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\tfi\n+else\n+\terror \"Could not identify web server '$LIB_HTTPD_PATH'\"\n+fi\n+\n+HTTPD_PARA=\"-d $HTTPD_ROOT_PATH -f $TEST_PATH/apache.conf\"\n+\n+prepare_httpd() {\n+\tmkdir $HTTPD_ROOT_PATH\n+\tmkdir $HTTPD_DOCUMENT_ROOT_PATH\n+\n+\tln -s $LIB_HTTPD_MODULE_PATH $HTTPD_ROOT_PATH/modules\n+\n+\tif test -n \"$LIB_HTTPD_SSL\"\n+\tthen\n+\t\tHTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT\n+\telse\n+\t\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\n+\tfi\n+\n+\tif test \"$LIB_HTTPD_SSL\" != \"\"\n+\tthen\n+\t\topenssl req \\\n+\t\t\t-config $TEST_PATH/ssl.cnf \\\n+\t\t\t-new -x509 -nodes \\\n+\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n+\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n+\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n+\tfi\n+\t\t\t\n+\tif test \"$LIB_HTTPD_DAV\" != \"\" -o \"$LIB_HTTPD_SVN\" != \"\"\n+\tthen\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DDAV\"\n+\n+\t\tif test \"$LIB_HTTPD_SVN\" != \"\"\n+\t\tthen\n+\t\t\tHTTPD_PARA=\"$HTTPD_PARA -DSVN\"\n+\t\t\trawsvnrepo=\"$HTTPD_ROOT_PATH/svnrepo\"\n+\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n+\t\tfi\n+\tfi\n+}\n+\n+start_httpd() {\n+\tprepare_httpd\n+\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA \\\n+\t\t-c \"Listen 127.0.0.1:$LIB_HTTPD_PORT\" -k start\n+}\n+\n+stop_httpd() {\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n+}\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nnew file mode 100644\nindex 0000000..a447346\n--- /dev/null\n+++ b/t/lib-httpd/apache.conf\n@@ -0,0 +1,34 @@\n+PidFile httpd.pid\n+DocumentRoot www\n+ErrorLog error.log\n+\n+<IfDefine SSL>\n+LoadModule ssl_module modules/mod_ssl.so\n+\n+SSLCertificateFile httpd.pem\n+SSLCertificateKeyFile httpd.pem\n+SSLRandomSeed startup file:/dev/urandom 512\n+SSLRandomSeed connect file:/dev/urandom 512\n+SSLSessionCache none\n+SSLMutex file:ssl_mutex\n+SSLEngine On\n+</IfDefine>\n+\n+<IfDefine DAV>\n+\tLoadModule dav_module modules/mod_dav.so\n+\tLoadModule dav_fs_module modules/mod_dav_fs.so\n+\n+\tDAVLockDB DAVLock\n+\t<Location />\n+\t\tDav on\n+\t</Location>\n+</IfDefine>\n+\n+<IfDefine SVN>\n+\tLoadModule dav_svn_module modules/mod_dav_svn.so\n+\n+\t<Location /svn>\n+\t\tDAV svn\n+\t\tSVNPath svnrepo\n+\t</Location>\n+</IfDefine>\ndiff --git a/t/lib-httpd/ssl.cnf b/t/lib-httpd/ssl.cnf\nnew file mode 100644\nindex 0000000..8d89a05\n--- /dev/null\n+++ b/t/lib-httpd/ssl.cnf\n@@ -0,0 +1,8 @@\n+RANDFILE                = $ENV::HOME/.rnd\n+\n+[ req ]\n+default_bits            = 1024\n+distinguished_name      = req_distinguished_name\n+prompt                  = no\n+[ req_distinguished_name ]\n+commonName              = 127.0.0.1\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nnew file mode 100644\nindex 0000000..c12e2ad\n--- /dev/null\n+++ b/t/t5540-http-push.sh\n@@ -0,0 +1,73 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+test_description='test http-push\n+\n+This test runs various sanity checks on http-push.'\n+\n+. ./test-lib.sh\n+\n+ROOT_PATH=\"$PWD\"\n+LIB_HTTPD_DAV=t\n+\n+. ../lib-httpd.sh\n+\n+if ! start_httpd >&3 2>&4\n+then\n+\tsay_color \"\" \"skipping test, web server setup failed\"\n+\ttest_done\n+\texit\n+fi\n+\n+test_expect_success 'setup remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tmkdir test_repo &&\n+\tcd test_repo &&\n+\tgit init &&\n+\t: >path1 &&\n+\tgit add path1 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tcd - &&\n+\tgit clone --bare test_repo test_repo.git &&\n+\tcd test_repo.git &&\n+\tgit --bare update-server-info &&\n+\tchmod +x hooks/post-update &&\n+\tcd - &&\n+\tmv test_repo.git $HTTPD_DOCUMENT_ROOT_PATH\n+'\n+\t\n+test_expect_success 'clone remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tgit clone $HTTPD_URL/test_repo.git test_repo_clone\n+'\n+\n+test_expect_success 'push to remote repository' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\t: >path2 &&\n+\tgit add path2 &&\n+\ttest_tick &&\n+\tgit commit -m path2 &&\n+\tgit push\n+'\n+\n+test_expect_success 'create and delete remote branch' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\tgit checkout -b dev &&\n+\t: >path3 &&\n+\tgit add path3 &&\n+\ttest_tick &&\n+\tgit commit -m dev &&\n+\tgit push origin dev &&\n+\tgit fetch &&\n+\tgit push origin :dev &&\n+\tgit branch -d -r origin/dev &&\n+\tgit fetch &&\n+\t! git show-ref --verify refs/remotes/origin/dev\n+'\n+\n+stop_httpd\n+\n+test_done\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"69951","messageId":"7vprukfttt.fsf@gitster.siamese.dyndns.org","threadId":"12175","inReplyTo":"20080225232820.GA18254@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-26T00:24:30Z","receivedAt":"2008-02-26T00:24:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Clemens Buchacher <drizzd@aon.at> writes:\n\n> http-push tests require a web server with WebDAV support.\n\nI'd rather see these tests that are heavyweight and (more\nimportantly) open a listened network ports kept strictly\noptional.  IOW, please enable them only when the user asks for\nthem, like some of the heavier GIT_SVN tests already do with\n\"make full-svn-test\" target.\n\n>  create mode 100644 t/lib-httpd.sh\n>  create mode 100644 t/lib-httpd/apache.conf\n>  create mode 100644 t/lib-httpd/ssl.cnf\n>  create mode 100644 t/t5540-http-push.sh\n\nOthers are Ok but the last one should be 100755 per convention.\n\n> +TEST_PATH=\"$PWD\"/../lib-httpd\n> +HTTPD_ROOT_PATH=\"$PWD\"/httpd\n> +HTTPD_DOCUMENT_ROOT_PATH=\"$PWD\"/httpd/www\n> +\n> +if ! test -x \"$LIB_HTTPD_PATH\"\n> +then\n> +        say_color \"\" \"skipping test, no web server found at $LIB_HTTPD_PATH\"\n\nJust use \"say\" to let \"say\" function pick the color.\n\n> +\tif test \"$LIB_HTTPD_DAV\" != \"\" -o \"$LIB_HTTPD_SVN\" != \"\"\n> +\tthen\n> +\t\tHTTPD_PARA=\"$HTTPD_PARA -DDAV\"\n> +\n> +\t\tif test \"$LIB_HTTPD_SVN\" != \"\"\n> +\t\tthen\n> +\t\t\tHTTPD_PARA=\"$HTTPD_PARA -DSVN\"\n> +\t\t\trawsvnrepo=\"$HTTPD_ROOT_PATH/svnrepo\"\n> +\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n\nSubversion???  Ah, you are preparing for enhancement of t91XX series?\n\n> +\t\tfi\n> +\tfi\n> +}\n> +\n> +start_httpd() {\n> +\tprepare_httpd\n> +\n> +\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA \\\n> +\t\t-c \"Listen 127.0.0.1:$LIB_HTTPD_PORT\" -k start\n> +}\n> +\n> +stop_httpd() {\n> +\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n> +}\n\nI have to wonder where it is arranged so that a test failure\n(including ^C out of it, or losing SSH connection to the\nterminal) would cause the server to be killed off.\n"},{"id":"70020","messageId":"20080226193206.GC16889@glandium.org","threadId":"12175","inReplyTo":"20080225232820.GA18254@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-26T19:32:06Z","receivedAt":"2008-02-26T19:32:06Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Tue, Feb 26, 2008 at 12:28:20AM +0100, Clemens Buchacher wrote:\n> http-push tests require a web server with WebDAV support.\n> \n> This commit introduces a HTTPD test library, which can be configured using\n> the following environment variables.\n> \n> LIB_HTTPD_PATH\t\tweb server path\n> LIB_HTTPD_MODULE_PATH\tweb server modules path\n> LIB_HTTPD_PORT\t\tlistening port\n> LIB_HTTPD_DAV\t\tenable DAV\n> LIB_HTTPD_SVN\t\tenable SVN\n> LIB_HTTPD_SSL\t\tenable SSL\n\nOverall, this looks fine to me, though I haven't taken a deep look at\nwhat the test itself does. I was more interested in the \"library\".\n\nJust a few nitpicks.\n\n> +HTTPD_ROOT_PATH=\"$PWD\"/httpd\n> +HTTPD_DOCUMENT_ROOT_PATH=\"$PWD\"/httpd/www\n\nWhy not just use $HTTPD_ROOT_PATH/www and don't use the\n$HTTPD_DOCUMENT_ROOT_PATH variable ?\n\n> +\tmkdir $HTTPD_ROOT_PATH\n> +\tmkdir $HTTPD_DOCUMENT_ROOT_PATH\n\nThis could become mkdir -p $HTTPD_ROOT_PATH/www\n\n> +\tif test -n \"$LIB_HTTPD_SSL\"\n> +\tif test \"$LIB_HTTPD_SSL\" != \"\"\n\nWhy use different tests?\n\n> +\t\topenssl req \\\n> +\t\t\t-config $TEST_PATH/ssl.cnf \\\n> +\t\t\t-new -x509 -nodes \\\n> +\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n> +\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n> +\t\texport GIT_SSL_NO_VERIFY=t\n> +\t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n\nFor future improvement (that could be another patch), it would probably\nbe nice to generate a CAcert and a certificate signed by it, so we can\nalso test without GIT_SSL_NO_VERIFY.\n\nBy the way, why not just include the .pem ?\n\n> +stop_httpd() {\n> +\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n> +}\n\nAs Junio said, it might be good to add a trap.\n\n> +RANDFILE                = $ENV::HOME/.rnd\n\nWouldn't it be better elsewhere ?\n\nMike\n"},{"id":"70070","messageId":"20080227085442.GA22501@localhost","threadId":"12175","inReplyTo":"7vprukfttt.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-27T08:54:42Z","receivedAt":"2008-02-27T08:54:42Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"http-push tests require a web server with WebDAV support.\n\nThis commit introduces a HTTPD test library, which can be configured using\nthe following environment variables.\n\nLIB_HTTPD_PATH\t\tweb server path\nLIB_HTTPD_MODULE_PATH\tweb server modules path\nLIB_HTTPD_PORT\t\tlistening port\nLIB_HTTPD_DAV\t\tenable DAV\nLIB_HTTPD_SVN\t\tenable SVN\nLIB_HTTPD_SSL\t\tenable SSL\n\nNetworking tests are disabled by default. Use GIT_TEST_OPTS=--network to\nenable.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nOn Mon, Feb 25, 2008 at 04:24:30PM -0800, Junio C Hamano wrote:\n> I'd rather see these tests that are heavyweight and (more\n> importantly) open a listened network ports kept strictly\n> optional.\n\nOk. I added the test option --network, which enables networking tests.\n\n> Subversion???  Ah, you are preparing for enhancement of t91XX series?\n\nYes.\n\n> I have to wonder where it is arranged so that a test failure\n> (including ^C out of it, or losing SSH connection to the\n> terminal) would cause the server to be killed off.\n\nI simply didn't know how to do that. I now copied the trap mechanism from\ntest-lib.sh, which I hope is the right thing to do. I didn't want to override\nthe test-lib.sh trap in lib-httpd.sh, so I wrapped the trap code in the\nfunction die().\n\nOn Tue, Feb 26, 2008 at 08:32:06PM +0100, Mike Hommey wrote:\n> > +HTTPD_ROOT_PATH=\"$PWD\"/httpd\n> > +HTTPD_DOCUMENT_ROOT_PATH=\"$PWD\"/httpd/www\n> \n> Why not just use $HTTPD_ROOT_PATH/www and don't use the\n> $HTTPD_DOCUMENT_ROOT_PATH variable ?\n\nI wanted to discourage the test case writer to use HTTPD_ROOT_PATH directly,\nbecause it should not be any of his concern.\n\n> > +\tmkdir $HTTPD_ROOT_PATH\n> > +\tmkdir $HTTPD_DOCUMENT_ROOT_PATH\n> \n> This could become mkdir -p $HTTPD_ROOT_PATH/www\n\nI wanted to state explicitly that HTTPD_ROOT_PATH and HTTPD_DOCUMENT_ROOT_PATH\ndo not have to be related. I added the -p flag to both commands, however.\n\n> > +\tif test -n \"$LIB_HTTPD_SSL\"\n> > +\tif test \"$LIB_HTTPD_SSL\" != \"\"\n> \n> Why use different tests?\n\nI picked up the latter one while reading code from other tests, so my coding\nstyle changed while implementing this patch. I'll now stick to test -n and test\n-z, if that's ok.\n\n> > +\t\topenssl req \\\n> > +\t\t\t-config $TEST_PATH/ssl.cnf \\\n> > +\t\t\t-new -x509 -nodes \\\n> > +\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n> > +\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n> > +\t\texport GIT_SSL_NO_VERIFY=t\n> > +\t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n> \n> For future improvement (that could be another patch), it would probably\n> be nice to generate a CAcert and a certificate signed by it, so we can\n> also test without GIT_SSL_NO_VERIFY.\n> \n> By the way, why not just include the .pem ?\n\nI included the generation of the .pem file mainly for documentation purposes\nand in order to allow improvements like the one you are suggesting. The\ndownside is that it requires openssl, but I think whoever wants to test SSL is\nlikely to have it installed. Right?\n\n> > +stop_httpd() {\n> > +\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n> > +}\n> \n> As Junio said, it might be good to add a trap.\n\nIndeed.\n\n> > +RANDFILE                = $ENV::HOME/.rnd\n> \n> Wouldn't it be better elsewhere ?\n\nTrue.\n\nI tried to incorporate all your suggestions. I hope I didn't miss anything.\n\nRegards,\nClemens\n\n t/lib-httpd.sh          |   97 +++++++++++++++++++++++++++++++++++++++++++++++\n t/lib-httpd/apache.conf |   34 ++++++++++++++++\n t/lib-httpd/ssl.cnf     |    8 ++++\n t/t5540-http-push.sh    |   73 +++++++++++++++++++++++++++++++++++\n t/test-lib.sh           |   16 +++++++-\n 5 files changed, 226 insertions(+), 2 deletions(-)\n create mode 100644 t/lib-httpd.sh\n create mode 100644 t/lib-httpd/apache.conf\n create mode 100644 t/lib-httpd/ssl.cnf\n create mode 100755 t/t5540-http-push.sh\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nnew file mode 100644\nindex 0000000..2d01fc9\n--- /dev/null\n+++ b/t/lib-httpd.sh\n@@ -0,0 +1,97 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+if test -z \"$GIT_TEST_NET\"\n+then\n+\tsay \"skipping test, network testing disabled by default\"\n+\tsay \"(define GIT_TEST_OPTS=--net to enable)\"\n+\ttest_done\n+\texit\n+fi\n+\n+LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}\n+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}\n+\n+TEST_PATH=\"$PWD\"/../lib-httpd\n+HTTPD_ROOT_PATH=\"$PWD\"/httpd\n+HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www\n+\n+if ! test -x \"$LIB_HTTPD_PATH\"\n+then\n+        say \"skipping test, no web server found at '$LIB_HTTPD_PATH'\"\n+        test_done\n+        exit\n+fi\n+\n+HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \\\n+\tsed -n 's/^Server version: Apache\\/\\([0-9]*\\)\\..*$/\\1/p; q'`\n+\n+if test -n \"$HTTPD_VERSION\"\n+then\n+\tif test -z \"$LIB_HTTPD_MODULE_PATH\"\n+\tthen\n+\t\tif ! test $HTTPD_VERSION -ge 2\n+\t\tthen\n+\t\t\tsay \"skipping test, at least Apache version 2 is required\"\n+\t\t\ttest_done\n+\t\t\texit\n+\t\tfi\n+\n+\t\tLIB_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\tfi\n+else\n+\terror \"Could not identify web server at '$LIB_HTTPD_PATH'\"\n+fi\n+\n+HTTPD_PARA=\"-d $HTTPD_ROOT_PATH -f $TEST_PATH/apache.conf\"\n+\n+prepare_httpd() {\n+\tmkdir -p $HTTPD_ROOT_PATH\n+\tmkdir -p $HTTPD_DOCUMENT_ROOT_PATH\n+\n+\tln -s $LIB_HTTPD_MODULE_PATH $HTTPD_ROOT_PATH/modules\n+\n+\tif test -n \"$LIB_HTTPD_SSL\"\n+\tthen\n+\t\tHTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT\n+\n+\t\tRANDFILE_PATH=\"$HTTPD_ROOT_PATH\"/.rnd openssl req \\\n+\t\t\t-config $TEST_PATH/ssl.cnf \\\n+\t\t\t-new -x509 -nodes \\\n+\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n+\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n+\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n+\telse\n+\t\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\n+\tfi\n+\n+\tif test -n \"$LIB_HTTPD_DAV\" -o -n \"$LIB_HTTPD_SVN\"\n+\tthen\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DDAV\"\n+\n+\t\tif test -n \"$LIB_HTTPD_SVN\"\n+\t\tthen\n+\t\t\tHTTPD_PARA=\"$HTTPD_PARA -DSVN\"\n+\t\t\trawsvnrepo=\"$HTTPD_ROOT_PATH/svnrepo\"\n+\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n+\t\tfi\n+\tfi\n+}\n+\n+start_httpd() {\n+\tprepare_httpd\n+\n+\ttrap 'stop_httpd; die' exit\n+\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA \\\n+\t\t-c \"Listen 127.0.0.1:$LIB_HTTPD_PORT\" -k start\n+}\n+\n+stop_httpd() {\n+\ttrap 'die' exit\n+\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n+}\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nnew file mode 100644\nindex 0000000..a447346\n--- /dev/null\n+++ b/t/lib-httpd/apache.conf\n@@ -0,0 +1,34 @@\n+PidFile httpd.pid\n+DocumentRoot www\n+ErrorLog error.log\n+\n+<IfDefine SSL>\n+LoadModule ssl_module modules/mod_ssl.so\n+\n+SSLCertificateFile httpd.pem\n+SSLCertificateKeyFile httpd.pem\n+SSLRandomSeed startup file:/dev/urandom 512\n+SSLRandomSeed connect file:/dev/urandom 512\n+SSLSessionCache none\n+SSLMutex file:ssl_mutex\n+SSLEngine On\n+</IfDefine>\n+\n+<IfDefine DAV>\n+\tLoadModule dav_module modules/mod_dav.so\n+\tLoadModule dav_fs_module modules/mod_dav_fs.so\n+\n+\tDAVLockDB DAVLock\n+\t<Location />\n+\t\tDav on\n+\t</Location>\n+</IfDefine>\n+\n+<IfDefine SVN>\n+\tLoadModule dav_svn_module modules/mod_dav_svn.so\n+\n+\t<Location /svn>\n+\t\tDAV svn\n+\t\tSVNPath svnrepo\n+\t</Location>\n+</IfDefine>\ndiff --git a/t/lib-httpd/ssl.cnf b/t/lib-httpd/ssl.cnf\nnew file mode 100644\nindex 0000000..6dab257\n--- /dev/null\n+++ b/t/lib-httpd/ssl.cnf\n@@ -0,0 +1,8 @@\n+RANDFILE                = $ENV::RANDFILE_PATH\n+\n+[ req ]\n+default_bits            = 1024\n+distinguished_name      = req_distinguished_name\n+prompt                  = no\n+[ req_distinguished_name ]\n+commonName              = 127.0.0.1\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nnew file mode 100755\nindex 0000000..7372439\n--- /dev/null\n+++ b/t/t5540-http-push.sh\n@@ -0,0 +1,73 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+test_description='test http-push\n+\n+This test runs various sanity checks on http-push.'\n+\n+. ./test-lib.sh\n+\n+ROOT_PATH=\"$PWD\"\n+LIB_HTTPD_DAV=t\n+\n+. ../lib-httpd.sh\n+\n+if ! start_httpd >&3 2>&4\n+then\n+\tsay \"skipping test, web server setup failed\"\n+\ttest_done\n+\texit\n+fi\n+\n+test_expect_success 'setup remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tmkdir test_repo &&\n+\tcd test_repo &&\n+\tgit init &&\n+\t: >path1 &&\n+\tgit add path1 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tcd - &&\n+\tgit clone --bare test_repo test_repo.git &&\n+\tcd test_repo.git &&\n+\tgit --bare update-server-info &&\n+\tchmod +x hooks/post-update &&\n+\tcd - &&\n+\tmv test_repo.git $HTTPD_DOCUMENT_ROOT_PATH\n+'\n+\t\n+test_expect_success 'clone remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tgit clone $HTTPD_URL/test_repo.git test_repo_clone\n+'\n+\n+test_expect_success 'push to remote repository' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\t: >path2 &&\n+\tgit add path2 &&\n+\ttest_tick &&\n+\tgit commit -m path2 &&\n+\tgit push\n+'\n+\n+test_expect_success 'create and delete remote branch' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\tgit checkout -b dev &&\n+\t: >path3 &&\n+\tgit add path3 &&\n+\ttest_tick &&\n+\tgit commit -m dev &&\n+\tgit push origin dev &&\n+\tgit fetch &&\n+\tgit push origin :dev &&\n+\tgit branch -d -r origin/dev &&\n+\tgit fetch &&\n+\t! git show-ref --verify refs/remotes/origin/dev\n+'\n+\n+stop_httpd\n+\n+test_done\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 83889c4..e33b13b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -79,8 +79,10 @@ do\n \t\tverbose=t; shift ;;\n \t-q|--q|--qu|--qui|--quie|--quiet)\n \t\tquiet=t; shift ;;\n+\t-n|--n|--ne|--net|--netw|--netwo|--networ|--network)\n+\t\tnetwork=t; shift ;;\n \t--no-color)\n-\t    color=; shift ;;\n+\t\tcolor=; shift ;;\n \t--no-python)\n \t\t# noop now...\n \t\tshift ;;\n@@ -89,6 +91,11 @@ do\n \tesac\n done\n \n+if test -n \"$network\"\n+then\n+\tGIT_TEST_NET=t\n+fi\n+\n if test -n \"$color\"; then\n \tsay_color () {\n \t\tcase \"$1\" in\n@@ -142,7 +149,12 @@ test_count=0\n test_fixed=0\n test_broken=0\n \n-trap 'echo >&5 \"FATAL: Unexpected exit with code $?\"; exit 1' exit\n+die () {\n+\techo >&5 \"FATAL: Unexpected exit with code $?\"\n+\texit 1\n+}\n+\n+trap 'die' exit\n \n test_tick () {\n \tif test -z \"${test_tick+set}\"\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"70071","messageId":"20080227091640.GA19272@glandium.org","threadId":"12175","inReplyTo":"20080227085442.GA22501@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-27T09:16:42Z","receivedAt":"2008-02-27T09:16:42Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Wed, Feb 27, 2008 at 09:54:42AM +0100, Clemens Buchacher <drizzd@aon.at> wrote:\n> http-push tests require a web server with WebDAV support.\n> \n> This commit introduces a HTTPD test library, which can be configured using\n> the following environment variables.\n> \n> LIB_HTTPD_PATH\t\tweb server path\n> LIB_HTTPD_MODULE_PATH\tweb server modules path\n> LIB_HTTPD_PORT\t\tlistening port\n> LIB_HTTPD_DAV\t\tenable DAV\n> LIB_HTTPD_SVN\t\tenable SVN\n> LIB_HTTPD_SSL\t\tenable SSL\n> \n> Networking tests are disabled by default. Use GIT_TEST_OPTS=--network to\n> enable.\n> \n> Signed-off-by: Clemens Buchacher <drizzd@aon.at>\nAcked-by: Mike Hommey <mh@glandium.org>\n\n\nHowever, last remark:\n> I wanted to state explicitly that HTTPD_ROOT_PATH and HTTPD_DOCUMENT_ROOT_PATH\n> do not have to be related. I added the -p flag to both commands, however.\n\nThey *are* related, because HTTPD_DOCUMENT_ROOT_PATH is what is in httpd.conf,\nset with the DocumentRoot directive, and it's a path relative to\nHTTPD_ROOT_PATH. And it is set statically to \"www\".\n\nMike\n"},{"id":"70075","messageId":"alpine.LSU.1.00.0802270947110.22527@racer.site","threadId":"12175","inReplyTo":"20080227085442.GA22501@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-27T09:51:35Z","receivedAt":"2008-02-27T09:51:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 27 Feb 2008, Clemens Buchacher wrote:\n\n> Networking tests are disabled by default. Use GIT_TEST_OPTS=--network to\n> enable.\n\nOne request in addition to Mike's: please make this an environment \nvariable such as \"GIT_TEST_HTTPD\".  IOW, instead of this:\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 83889c4..e33b13b 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -79,8 +79,10 @@ do\n>  \t\tverbose=t; shift ;;\n>  \t-q|--q|--qu|--qui|--quie|--quiet)\n>  \t\tquiet=t; shift ;;\n> +\t-n|--n|--ne|--net|--netw|--netwo|--networ|--network)\n> +\t\tnetwork=t; shift ;;\n>  \t--no-color)\n> -\t    color=; shift ;;\n> +\t\tcolor=; shift ;;\n>  \t--no-python)\n>  \t\t# noop now...\n>  \t\tshift ;;\n> @@ -89,6 +91,11 @@ do\n>  \tesac\n>  done\n>  \n> +if test -n \"$network\"\n> +then\n> +\tGIT_TEST_NET=t\n> +fi\n> +\n>  if test -n \"$color\"; then\n>  \tsay_color () {\n>  \t\tcase \"$1\" in\n\njust rename the variable \"GIT_TEST_NET\" in lib-httpd.sh to \n\"GIT_TEST_HTTPD\".\n\nThanks,\nDscho\n"},{"id":"70143","messageId":"20080227192334.GA1818@localhost","threadId":"12175","inReplyTo":"alpine.LSU.1.00.0802270947110.22527@racer.site","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-27T19:23:34Z","receivedAt":"2008-02-27T19:23:34Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Hi,\n\nOn Wed, Feb 27, 2008 at 09:51:35AM +0000, Johannes Schindelin wrote:\n> just rename the variable \"GIT_TEST_NET\" in lib-httpd.sh to \n> \"GIT_TEST_HTTPD\".\n\nMy intention was to use this variable as a global \"enable network testing\"\nflag, as implicated by Junio. I don't see a real usecase for enabling only\nHTTPD tests, as opposed to other networking tests for git-daemon or git-shell,\nfor example. But here you go.\n\nOn Wed, Feb 27, 2008 at 10:16:42AM +0100, Mike Hommey wrote:\n> > I wanted to state explicitly that HTTPD_ROOT_PATH and\n> > HTTPD_DOCUMENT_ROOT_PATH do not have to be related. I added the -p flag to\n> > both commands, however.\n> \n> They *are* related, because HTTPD_DOCUMENT_ROOT_PATH is what is in\n> httpd.conf, set with the DocumentRoot directive, and it's a path relative to\n> HTTPD_ROOT_PATH. And it is set statically to \"www\".\n\nThis dependency can easily be removed by using a symlink. But I don't feel\nstrongly enough about this point to resist any longer. :-)\n\nThank you again for your numerous suggestions. I will resubmit both patches in\nreply to this message.\n\nRegards,\nClemens\n"},{"id":"70144","messageId":"20080227192753.GB1818@localhost","threadId":"12175","inReplyTo":"20080227192334.GA1818@localhost","subject":"[PATCH 1/2] http-push: push <remote> :<branch> deletes remote branch","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-27T19:27:53Z","receivedAt":"2008-02-27T19:27:53Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"This mirrors current ssh/git push syntax.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n http-push.c |   17 ++++++++++++-----\n 1 files changed, 12 insertions(+), 5 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 0beb740..4b31070 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2138,6 +2138,8 @@ static int delete_remote_branch(char *pattern, int force)\n \n \t/* Send delete request */\n \tfprintf(stderr, \"Removing remote branch '%s'\\n\", remote_ref->name);\n+\tif (dry_run)\n+\t\treturn 0;\n \turl = xmalloc(strlen(remote->url) + strlen(remote_ref->name) + 1);\n \tsprintf(url, \"%s%s\", remote->url, remote_ref->name);\n \tslot = get_active_slot();\n@@ -2311,6 +2313,16 @@ int main(int argc, char **argv)\n \n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n+\n+\t\tif (is_zero_sha1(ref->peer_ref->new_sha1)) {\n+\t\t\tif (delete_remote_branch(ref->name, 1) == -1) {\n+\t\t\t\terror(\"Could not remove %s\", ref->name);\n+\t\t\t\trc = -4;\n+\t\t\t}\n+\t\t\tnew_refs++;\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tif (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {\n \t\t\tif (push_verbosely || 1)\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n@@ -2342,11 +2354,6 @@ int main(int argc, char **argv)\n \t\t\t}\n \t\t}\n \t\thashcpy(ref->new_sha1, ref->peer_ref->new_sha1);\n-\t\tif (is_zero_sha1(ref->new_sha1)) {\n-\t\t\terror(\"cannot happen anymore\");\n-\t\t\trc = -3;\n-\t\t\tcontinue;\n-\t\t}\n \t\tnew_refs++;\n \t\tstrcpy(old_hex, sha1_to_hex(ref->old_sha1));\n \t\tnew_hex = sha1_to_hex(ref->new_sha1);\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"70146","messageId":"20080227192845.GC1818@localhost","threadId":"12175","inReplyTo":"20080227192334.GA1818@localhost","subject":"[PATCH 2/2] http-push: add regression tests","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-02-27T19:28:45Z","receivedAt":"2008-02-27T19:28:45Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"http-push tests require a web server with WebDAV support.\n\nThis commit introduces a HTTPD test library, which can be configured using\nthe following environment variables.\n\nGIT_TEST_HTTPD\t\tenable HTTPD tests\nLIB_HTTPD_PATH\t\tweb server path\nLIB_HTTPD_MODULE_PATH\tweb server modules path\nLIB_HTTPD_PORT\t\tlistening port\nLIB_HTTPD_DAV\t\tenable DAV\nLIB_HTTPD_SVN\t\tenable SVN\nLIB_HTTPD_SSL\t\tenable SSL\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n t/lib-httpd.sh          |   96 +++++++++++++++++++++++++++++++++++++++++++++++\n t/lib-httpd/apache.conf |   34 ++++++++++++++++\n t/lib-httpd/ssl.cnf     |    8 ++++\n t/t5540-http-push.sh    |   73 +++++++++++++++++++++++++++++++++++\n t/test-lib.sh           |    9 +++-\n 5 files changed, 218 insertions(+), 2 deletions(-)\n create mode 100644 t/lib-httpd.sh\n create mode 100644 t/lib-httpd/apache.conf\n create mode 100644 t/lib-httpd/ssl.cnf\n create mode 100755 t/t5540-http-push.sh\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nnew file mode 100644\nindex 0000000..7f206c5\n--- /dev/null\n+++ b/t/lib-httpd.sh\n@@ -0,0 +1,96 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+if test -z \"$GIT_TEST_HTTPD\"\n+then\n+\tsay \"skipping test, network testing disabled by default\"\n+\tsay \"(define GIT_TEST_HTTPD to enable)\"\n+\ttest_done\n+\texit\n+fi\n+\n+LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}\n+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}\n+\n+TEST_PATH=\"$PWD\"/../lib-httpd\n+HTTPD_ROOT_PATH=\"$PWD\"/httpd\n+HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www\n+\n+if ! test -x \"$LIB_HTTPD_PATH\"\n+then\n+        say \"skipping test, no web server found at '$LIB_HTTPD_PATH'\"\n+        test_done\n+        exit\n+fi\n+\n+HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \\\n+\tsed -n 's/^Server version: Apache\\/\\([0-9]*\\)\\..*$/\\1/p; q'`\n+\n+if test -n \"$HTTPD_VERSION\"\n+then\n+\tif test -z \"$LIB_HTTPD_MODULE_PATH\"\n+\tthen\n+\t\tif ! test $HTTPD_VERSION -ge 2\n+\t\tthen\n+\t\t\tsay \"skipping test, at least Apache version 2 is required\"\n+\t\t\ttest_done\n+\t\t\texit\n+\t\tfi\n+\n+\t\tLIB_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'\n+\tfi\n+else\n+\terror \"Could not identify web server at '$LIB_HTTPD_PATH'\"\n+fi\n+\n+HTTPD_PARA=\"-d $HTTPD_ROOT_PATH -f $TEST_PATH/apache.conf\"\n+\n+prepare_httpd() {\n+\tmkdir -p $HTTPD_DOCUMENT_ROOT_PATH\n+\n+\tln -s $LIB_HTTPD_MODULE_PATH $HTTPD_ROOT_PATH/modules\n+\n+\tif test -n \"$LIB_HTTPD_SSL\"\n+\tthen\n+\t\tHTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT\n+\n+\t\tRANDFILE_PATH=\"$HTTPD_ROOT_PATH\"/.rnd openssl req \\\n+\t\t\t-config $TEST_PATH/ssl.cnf \\\n+\t\t\t-new -x509 -nodes \\\n+\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n+\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n+\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n+\telse\n+\t\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\n+\tfi\n+\n+\tif test -n \"$LIB_HTTPD_DAV\" -o -n \"$LIB_HTTPD_SVN\"\n+\tthen\n+\t\tHTTPD_PARA=\"$HTTPD_PARA -DDAV\"\n+\n+\t\tif test -n \"$LIB_HTTPD_SVN\"\n+\t\tthen\n+\t\t\tHTTPD_PARA=\"$HTTPD_PARA -DSVN\"\n+\t\t\trawsvnrepo=\"$HTTPD_ROOT_PATH/svnrepo\"\n+\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n+\t\tfi\n+\tfi\n+}\n+\n+start_httpd() {\n+\tprepare_httpd\n+\n+\ttrap 'stop_httpd; die' exit\n+\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA \\\n+\t\t-c \"Listen 127.0.0.1:$LIB_HTTPD_PORT\" -k start\n+}\n+\n+stop_httpd() {\n+\ttrap 'die' exit\n+\n+\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n+}\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nnew file mode 100644\nindex 0000000..a447346\n--- /dev/null\n+++ b/t/lib-httpd/apache.conf\n@@ -0,0 +1,34 @@\n+PidFile httpd.pid\n+DocumentRoot www\n+ErrorLog error.log\n+\n+<IfDefine SSL>\n+LoadModule ssl_module modules/mod_ssl.so\n+\n+SSLCertificateFile httpd.pem\n+SSLCertificateKeyFile httpd.pem\n+SSLRandomSeed startup file:/dev/urandom 512\n+SSLRandomSeed connect file:/dev/urandom 512\n+SSLSessionCache none\n+SSLMutex file:ssl_mutex\n+SSLEngine On\n+</IfDefine>\n+\n+<IfDefine DAV>\n+\tLoadModule dav_module modules/mod_dav.so\n+\tLoadModule dav_fs_module modules/mod_dav_fs.so\n+\n+\tDAVLockDB DAVLock\n+\t<Location />\n+\t\tDav on\n+\t</Location>\n+</IfDefine>\n+\n+<IfDefine SVN>\n+\tLoadModule dav_svn_module modules/mod_dav_svn.so\n+\n+\t<Location /svn>\n+\t\tDAV svn\n+\t\tSVNPath svnrepo\n+\t</Location>\n+</IfDefine>\ndiff --git a/t/lib-httpd/ssl.cnf b/t/lib-httpd/ssl.cnf\nnew file mode 100644\nindex 0000000..6dab257\n--- /dev/null\n+++ b/t/lib-httpd/ssl.cnf\n@@ -0,0 +1,8 @@\n+RANDFILE                = $ENV::RANDFILE_PATH\n+\n+[ req ]\n+default_bits            = 1024\n+distinguished_name      = req_distinguished_name\n+prompt                  = no\n+[ req_distinguished_name ]\n+commonName              = 127.0.0.1\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nnew file mode 100755\nindex 0000000..7372439\n--- /dev/null\n+++ b/t/t5540-http-push.sh\n@@ -0,0 +1,73 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n+#\n+\n+test_description='test http-push\n+\n+This test runs various sanity checks on http-push.'\n+\n+. ./test-lib.sh\n+\n+ROOT_PATH=\"$PWD\"\n+LIB_HTTPD_DAV=t\n+\n+. ../lib-httpd.sh\n+\n+if ! start_httpd >&3 2>&4\n+then\n+\tsay \"skipping test, web server setup failed\"\n+\ttest_done\n+\texit\n+fi\n+\n+test_expect_success 'setup remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tmkdir test_repo &&\n+\tcd test_repo &&\n+\tgit init &&\n+\t: >path1 &&\n+\tgit add path1 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tcd - &&\n+\tgit clone --bare test_repo test_repo.git &&\n+\tcd test_repo.git &&\n+\tgit --bare update-server-info &&\n+\tchmod +x hooks/post-update &&\n+\tcd - &&\n+\tmv test_repo.git $HTTPD_DOCUMENT_ROOT_PATH\n+'\n+\t\n+test_expect_success 'clone remote repository' '\n+\tcd \"$ROOT_PATH\" &&\n+\tgit clone $HTTPD_URL/test_repo.git test_repo_clone\n+'\n+\n+test_expect_success 'push to remote repository' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\t: >path2 &&\n+\tgit add path2 &&\n+\ttest_tick &&\n+\tgit commit -m path2 &&\n+\tgit push\n+'\n+\n+test_expect_success 'create and delete remote branch' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\tgit checkout -b dev &&\n+\t: >path3 &&\n+\tgit add path3 &&\n+\ttest_tick &&\n+\tgit commit -m dev &&\n+\tgit push origin dev &&\n+\tgit fetch &&\n+\tgit push origin :dev &&\n+\tgit branch -d -r origin/dev &&\n+\tgit fetch &&\n+\t! git show-ref --verify refs/remotes/origin/dev\n+'\n+\n+stop_httpd\n+\n+test_done\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 83889c4..9d9cb8d 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -80,7 +80,7 @@ do\n \t-q|--q|--qu|--qui|--quie|--quiet)\n \t\tquiet=t; shift ;;\n \t--no-color)\n-\t    color=; shift ;;\n+\t\tcolor=; shift ;;\n \t--no-python)\n \t\t# noop now...\n \t\tshift ;;\n@@ -142,7 +142,12 @@ test_count=0\n test_fixed=0\n test_broken=0\n \n-trap 'echo >&5 \"FATAL: Unexpected exit with code $?\"; exit 1' exit\n+die () {\n+\techo >&5 \"FATAL: Unexpected exit with code $?\"\n+\texit 1\n+}\n+\n+trap 'die' exit\n \n test_tick () {\n \tif test -z \"${test_tick+set}\"\n-- \n1.5.4.2.156.ge3c5\n"},{"id":"70167","messageId":"alpine.LSU.1.00.0802272223121.22527@racer.site","threadId":"12175","inReplyTo":"20080227192334.GA1818@localhost","subject":"Re: [PATCH] http-push: add regression tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-27T22:24:00Z","receivedAt":"2008-02-27T22:24:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 27 Feb 2008, Clemens Buchacher wrote:\n\n> Thank you again for your numerous suggestions. I will resubmit both \n> patches in reply to this message.\n\nIt is not strictly my turf, so I cannot ACK it, but here goes my\n\nLiked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nCiao,\nDscho\n"}]}