{"thread":{"id":"28293","subject":"[BUG] git push --quiet fails with older versions","startedAt":"2011-09-03T10:57:23Z","lastAt":"2011-09-06T19:52:03Z","messageCount":17,"participants":["Tobias Ulmer","Clemens Buchacher","Junio C Hamano","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"174785","messageId":"20110903105723.GA16304@tin.tmux.org","threadId":"28293","inReplyTo":null,"subject":"[BUG] git push --quiet fails with older versions","fromName":"Tobias Ulmer","fromEmail":"tobiasu@tmux.org","sentAt":"2011-09-03T10:57:23Z","receivedAt":"2011-09-03T10:57:23Z","isPatch":false,"sender":{"key":"tobiasu@tmux.org","avatar":"https://avatars.githubusercontent.com/u/357723?v=4"},"body":"Hi guys,\n\nmy distro updated git to 1.7.6.1. Now git push --quiet, used in various\nscripts, blows up against 1.7.6. I don't know how backwards compatible\ngit tries to be, but in my opinion that seems like a regression for a\npatchlevel release.\n\nThe problem seems to be that the remote git receive-pack does not\nunderstand --quiet. Maybe it is possible to check for the remote version\nbefore sending incompatible commandline parameters?\n\nQuick demo:\n\nlead:ssh$ git version\ngit version 1.7.6.1\nlead:ssh$ git push\nEverything up-to-date\nlead:ssh$ git push -q\nusage: git receive-pack <git-dir>\nfatal: The remote end hung up unexpectedly\n\nThe remote uses:\nradon:~$ git version\ngit version 1.7.6\n\nPlease keep me in CC, I'm not subscribed.\n\nTobias\n"},{"id":"174790","messageId":"1315067656-2846-1-git-send-email-drizzd@aon.at","threadId":"28293","inReplyTo":"20110903105723.GA16304@tin.tmux.org","subject":"Re: [BUG] git push --quiet fails with older versions","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-09-03T16:34:13Z","receivedAt":"2011-09-03T16:34:13Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Hello Tobias,\n\nOn Sat, Sep 03, 2011 at 12:57:23PM +0200, Tobias Ulmer wrote:\n> \n> my distro updated git to 1.7.6.1. Now git push --quiet, used in various\n> scripts, blows up against 1.7.6. I don't know how backwards compatible\n> git tries to be, but in my opinion that seems like a regression for a\n> patchlevel release.\n\nYes, that's a good point. I did not consider that.\n\n> The problem seems to be that the remote git receive-pack does not\n> understand --quiet. Maybe it is possible to check for the remote version\n> before sending incompatible commandline parameters?\n\nIndeed, that's what we must do. I am sending three patches in reply\nto this email:\n\n[PATCH 1/3] tests for push --quiet\n[PATCH 2/3] fix push --quiet via http\n[PATCH 3/3] push: old receive-pack does not understand --quiet\n\nThe third one fixes this issue on the client side.  It does not\ndepend on the first two. It applies to v1.7.6.1, maint, and master.\nWould be great if you could test.\n\nThanks,\nClemens\n"},{"id":"174791","messageId":"1315067656-2846-2-git-send-email-drizzd@aon.at","threadId":"28293","inReplyTo":"1315067656-2846-1-git-send-email-drizzd@aon.at","subject":"[PATCH 1/3] tests for push --quiet","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-09-03T16:34:14Z","receivedAt":"2011-09-03T16:34:14Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n t/t5523-push-upstream.sh |    7 +++++++\n t/t5541-http-push.sh     |    8 ++++++++\n 2 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh\nindex c229fe6..9ee52cf 100755\n--- a/t/t5523-push-upstream.sh\n+++ b/t/t5523-push-upstream.sh\n@@ -108,4 +108,11 @@ test_expect_failure TTY 'push --no-progress suppresses progress' '\n \t! grep \"Writing objects\" err\n '\n \n+test_expect_success TTY 'quiet push' '\n+\tensure_fresh_upstream &&\n+\n+\ttest_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&\n+\ttest_cmp /dev/null output\n+'\n+\n test_done\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex a73c826..0dcb8df 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -5,6 +5,7 @@\n \n test_description='test smart pushing over http via http-backend'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n if test -n \"$NO_CURL\"; then\n \tskip_all='skipping test, git built without http support'\n@@ -154,5 +155,12 @@ test_expect_success 'push (chunked)' '\n \t test $HEAD = $(git rev-parse --verify HEAD))\n '\n \n+test_expect_failure TTY 'quiet push' '\n+\tcd \"$ROOT_PATH\"/test_repo_clone &&\n+\ttest_commit quiet &&\n+\ttest_terminal git push --quiet --no-progress 2>&1 | tee output &&\n+\ttest_cmp /dev/null output\n+'\n+\n stop_httpd\n test_done\n-- \n1.7.6.1\n"},{"id":"174792","messageId":"1315067656-2846-3-git-send-email-drizzd@aon.at","threadId":"28293","inReplyTo":"1315067656-2846-1-git-send-email-drizzd@aon.at","subject":"[PATCH 2/3] fix push --quiet via http","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-09-03T16:34:15Z","receivedAt":"2011-09-03T16:34:15Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"A verbosity of 0 means quiet for remote helpers.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n remote-curl.c        |    2 +-\n t/t5541-http-push.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 5798aa5..2341106 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -762,7 +762,7 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs)\n \t\targv[argc++] = \"--thin\";\n \tif (options.dry_run)\n \t\targv[argc++] = \"--dry-run\";\n-\tif (options.verbosity < 0)\n+\tif (options.verbosity == 0)\n \t\targv[argc++] = \"--quiet\";\n \telse if (options.verbosity > 1)\n \t\targv[argc++] = \"--verbose\";\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex 0dcb8df..e756a08 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -155,7 +155,7 @@ test_expect_success 'push (chunked)' '\n \t test $HEAD = $(git rev-parse --verify HEAD))\n '\n \n-test_expect_failure TTY 'quiet push' '\n+test_expect_success TTY 'quiet push' '\n \tcd \"$ROOT_PATH\"/test_repo_clone &&\n \ttest_commit quiet &&\n \ttest_terminal git push --quiet --no-progress 2>&1 | tee output &&\n-- \n1.7.6.1\n"},{"id":"174793","messageId":"1315067656-2846-4-git-send-email-drizzd@aon.at","threadId":"28293","inReplyTo":"1315067656-2846-1-git-send-email-drizzd@aon.at","subject":"[PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-09-03T16:34:16Z","receivedAt":"2011-09-03T16:34:16Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Commit 90a6c7d4 (propagate --quiet to send-pack/receive-pack)\nintroduced the --quiet option to receive-pack and made send-pack\npass that option. Older versions of receive-pack do not recognize\nthe option, however, and terminate immediately.\n\nThis change restores backwards compatibility by adding a 'quiet'\ncapability to receive-pack.\n\nReported-by: Tobias Ulmer <tobiasu@tmux.org>\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n builtin/receive-pack.c |   10 ++++++----\n builtin/send-pack.c    |   16 +++++++---------\n transport.c            |   10 +++-------\n 3 files changed, 16 insertions(+), 20 deletions(-)\n\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 60260d0..06c481a 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -31,6 +31,7 @@ static int transfer_unpack_limit = -1;\n static int unpack_limit = 100;\n static int report_status;\n static int use_sideband;\n+static int quiet;\n static int prefer_ofs_delta = 1;\n static int auto_update_server_info;\n static int auto_gc = 1;\n@@ -114,7 +115,7 @@ static int show_ref(const char *path, const unsigned char *sha1, int flag, void\n \telse\n \t\tpacket_write(1, \"%s %s%c%s%s\\n\",\n \t\t\t     sha1_to_hex(sha1), path, 0,\n-\t\t\t     \" report-status delete-refs side-band-64k\",\n+\t\t\t     \" report-status delete-refs side-band-64k quiet\",\n \t\t\t     prefer_ofs_delta ? \" ofs-delta\" : \"\");\n \tsent_capabilities = 1;\n \treturn 0;\n@@ -636,6 +637,8 @@ static struct command *read_head_info(void)\n \t\t\t\treport_status = 1;\n \t\t\tif (strstr(refname + reflen + 1, \"side-band-64k\"))\n \t\t\t\tuse_sideband = LARGE_PACKET_MAX;\n+\t\t\tif (strstr(refname + reflen + 1, \"quiet\"))\n+\t\t\t\tquiet = 1;\n \t\t}\n \t\tcmd = xcalloc(1, sizeof(struct command) + len - 80);\n \t\thashcpy(cmd->old_sha1, old_sha1);\n@@ -669,7 +672,7 @@ static const char *parse_pack_header(struct pack_header *hdr)\n \n static const char *pack_lockfile;\n \n-static const char *unpack(int quiet)\n+static const char *unpack()\n {\n \tstruct pack_header hdr;\n \tconst char *hdr_err;\n@@ -788,7 +791,6 @@ static void add_alternate_refs(void)\n \n int cmd_receive_pack(int argc, const char **argv, const char *prefix)\n {\n-\tint quiet = 0;\n \tint advertise_refs = 0;\n \tint stateless_rpc = 0;\n \tint i;\n@@ -855,7 +857,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)\n \t\tconst char *unpack_status = NULL;\n \n \t\tif (!delete_only(commands))\n-\t\t\tunpack_status = unpack(quiet);\n+\t\t\tunpack_status = unpack();\n \t\texecute_commands(commands, unpack_status);\n \t\tif (pack_lockfile)\n \t\t\tunlink_or_warn(pack_lockfile);\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex 40a1675..a8d6b4c 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -263,6 +263,8 @@ int send_pack(struct send_pack_args *args,\n \t\targs->use_ofs_delta = 1;\n \tif (server_supports(\"side-band-64k\"))\n \t\tuse_sideband = 1;\n+\tif (!server_supports(\"quiet\"))\n+\t\targs->quiet = 0;\n \n \tif (!remote_refs) {\n \t\tfprintf(stderr, \"No refs in common and none specified; doing nothing.\\n\"\n@@ -301,11 +303,12 @@ int send_pack(struct send_pack_args *args,\n \t\t\tchar *old_hex = sha1_to_hex(ref->old_sha1);\n \t\t\tchar *new_hex = sha1_to_hex(ref->new_sha1);\n \n-\t\t\tif (!cmds_sent && (status_report || use_sideband)) {\n-\t\t\t\tpacket_buf_write(&req_buf, \"%s %s %s%c%s%s\",\n+\t\t\tif (!cmds_sent && (status_report || use_sideband || args->quiet)) {\n+\t\t\t\tpacket_buf_write(&req_buf, \"%s %s %s%c%s%s%s\",\n \t\t\t\t\told_hex, new_hex, ref->name, 0,\n \t\t\t\t\tstatus_report ? \" report-status\" : \"\",\n-\t\t\t\t\tuse_sideband ? \" side-band-64k\" : \"\");\n+\t\t\t\t\tuse_sideband ? \" side-band-64k\" : \"\",\n+\t\t\t\t\targs->quiet ? \" quiet\" : \"\");\n \t\t\t}\n \t\t\telse\n \t\t\t\tpacket_buf_write(&req_buf, \"%s %s %s\",\n@@ -492,13 +495,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n \t\tfd[0] = 0;\n \t\tfd[1] = 1;\n \t} else {\n-\t\tstruct strbuf sb = STRBUF_INIT;\n-\t\tstrbuf_addstr(&sb, receivepack);\n-\t\tif (args.quiet)\n-\t\t\tstrbuf_addstr(&sb, \" --quiet\");\n-\t\tconn = git_connect(fd, dest, sb.buf,\n+\t\tconn = git_connect(fd, dest, receivepack,\n \t\t\targs.verbose ? CONNECT_VERBOSE : 0);\n-\t\tstrbuf_release(&sb);\n \t}\n \n \tmemset(&extra_have, 0, sizeof(extra_have));\ndiff --git a/transport.c b/transport.c\nindex 98c5778..c9c8056 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -482,18 +482,14 @@ static int set_git_option(struct git_transport_options *opts,\n static int connect_setup(struct transport *transport, int for_push, int verbose)\n {\n \tstruct git_transport_data *data = transport->data;\n-\tstruct strbuf sb = STRBUF_INIT;\n \n \tif (data->conn)\n \t\treturn 0;\n \n-\tstrbuf_addstr(&sb, for_push ? data->options.receivepack :\n-\t\t\t\t data->options.uploadpack);\n-\tif (for_push && transport->verbose < 0)\n-\t\tstrbuf_addstr(&sb, \" --quiet\");\n-\tdata->conn = git_connect(data->fd, transport->url, sb.buf,\n+\tdata->conn = git_connect(data->fd, transport->url,\n+\t\t\t\t for_push ? data->options.receivepack :\n+\t\t\t\t data->options.uploadpack,\n \t\t\t\t verbose ? CONNECT_VERBOSE : 0);\n-\tstrbuf_release(&sb);\n \n \treturn 0;\n }\n-- \n1.7.6.1\n"},{"id":"174807","messageId":"20110904120853.GB16587@tin.tmux.org","threadId":"28293","inReplyTo":"1315067656-2846-1-git-send-email-drizzd@aon.at","subject":"Re: [BUG] git push --quiet fails with older versions","fromName":"Tobias Ulmer","fromEmail":"tobiasu@tmux.org","sentAt":"2011-09-04T12:08:53Z","receivedAt":"2011-09-04T12:08:53Z","isPatch":false,"sender":{"key":"tobiasu@tmux.org","avatar":"https://avatars.githubusercontent.com/u/357723?v=4"},"body":"On Sat, Sep 03, 2011 at 06:34:13PM +0200, Clemens Buchacher wrote:\n> Hello Tobias,\n> \n> On Sat, Sep 03, 2011 at 12:57:23PM +0200, Tobias Ulmer wrote:\n> > \n> > my distro updated git to 1.7.6.1. Now git push --quiet, used in various\n> > scripts, blows up against 1.7.6. I don't know how backwards compatible\n> > git tries to be, but in my opinion that seems like a regression for a\n> > patchlevel release.\n> \n> Yes, that's a good point. I did not consider that.\n> \n> > The problem seems to be that the remote git receive-pack does not\n> > understand --quiet. Maybe it is possible to check for the remote version\n> > before sending incompatible commandline parameters?\n> \n> Indeed, that's what we must do. I am sending three patches in reply\n> to this email:\n> \n> [PATCH 1/3] tests for push --quiet\n> [PATCH 2/3] fix push --quiet via http\n> [PATCH 3/3] push: old receive-pack does not understand --quiet\n> \n> The third one fixes this issue on the client side.  It does not\n> depend on the first two. It applies to v1.7.6.1, maint, and master.\n> Would be great if you could test.\n\nHi Clemens,\n\nI've just gotten round to test patch 3/3 and it works perfectly against\n1.7.6 as well as 1.7.6.1. It suppresses the output if the remote git\nversion is 1.7.6.1, like it should.\n\nThanks for your quick response,\nTobias\n\n> \n> Thanks,\n> Clemens\n"},{"id":"174822","messageId":"7vty8syvtz.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"20110903105723.GA16304@tin.tmux.org","subject":"Re: [BUG] git push --quiet fails with older versions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-04T19:02:48Z","receivedAt":"2011-09-04T19:02:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tobias Ulmer <tobiasu@tmux.org> writes:\n\n> my distro updated git to 1.7.6.1. Now git push --quiet, used in various\n> scripts, blows up against 1.7.6.\n\nThis kind of regression is not acceptable not just for point maintenance\nrelease, but for feature releases. 1.7.7 client must work with 1.7.6\nserver just fine without such a breakage. I should have been more careful\nwhen reviewing.\n\nThanks for a report, Tobias, and thanks for a quick fix, Clemens.\n"},{"id":"174840","messageId":"7vy5y3yb6x.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"1315067656-2846-4-git-send-email-drizzd@aon.at","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-05T02:28:38Z","receivedAt":"2011-09-05T02:28:38Z","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> @@ -114,7 +115,7 @@ static int show_ref(const char *path, const unsigned char *sha1, int flag, void\n>  \telse\n>  \t\tpacket_write(1, \"%s %s%c%s%s\\n\",\n>  \t\t\t     sha1_to_hex(sha1), path, 0,\n> -\t\t\t     \" report-status delete-refs side-band-64k\",\n> +\t\t\t     \" report-status delete-refs side-band-64k quiet\",\n>  \t\t\t     prefer_ofs_delta ? \" ofs-delta\" : \"\");\n>  \tsent_capabilities = 1;\n>  \treturn 0;\n> @@ -636,6 +637,8 @@ static struct command *read_head_info(void)\n>  \t\t\t\treport_status = 1;\n>  \t\t\tif (strstr(refname + reflen + 1, \"side-band-64k\"))\n>  \t\t\t\tuse_sideband = LARGE_PACKET_MAX;\n> +\t\t\tif (strstr(refname + reflen + 1, \"quiet\"))\n> +\t\t\t\tquiet = 1;\n\nSide note.\n\nWe may want to make sure that this is not part of a different token word\n(if we knew better, we would have written the other side so that we can\njust test against \" quiet \", but that is not possible, sigh...).\n\n>  \t\t}\n>  \t\tcmd = xcalloc(1, sizeof(struct command) + len - 80);\n>  \t\thashcpy(cmd->old_sha1, old_sha1);\n> @@ -669,7 +672,7 @@ static const char *parse_pack_header(struct pack_header *hdr)\n>  \n>  static const char *pack_lockfile;\n>  \n> -static const char *unpack(int quiet)\n> +static const char *unpack()\n\nI'll amend this as \"static const char *unpack(void)\" while applying.\n"},{"id":"174842","messageId":"7vmxejy9od.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"7vy5y3yb6x.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-05T03:01:22Z","receivedAt":"2011-09-05T03:01:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Clemens Buchacher <drizzd@aon.at> writes:\n> ...\n>> @@ -636,6 +637,8 @@ static struct command *read_head_info(void)\n>>  \t\t\t\treport_status = 1;\n>>  \t\t\tif (strstr(refname + reflen + 1, \"side-band-64k\"))\n>>  \t\t\t\tuse_sideband = LARGE_PACKET_MAX;\n>> +\t\t\tif (strstr(refname + reflen + 1, \"quiet\"))\n>> +\t\t\t\tquiet = 1;\n>\n> Side note.\n>\n> We may want to make sure that this is not part of a different token word\n> (if we knew better, we would have written the other side so that we can\n> just test against \" quiet \", but that is not possible, sigh...).\n\n... but we can do this.\n\n-- >8 --\nSubject: [PATCH] server_supports(): parse feature list more carefully\n\nWe have been carefully choosing feature names used in the protocol\nextensions so that the vocabulary does not contain a word that is a\nsubstring of another word, so it is not a real problem, but we have\nrecently added \"quiet\" feature word, which would mean we cannot later\nadd some other word with \"quiet\" (e.g. \"quiet-push\"), which is awkward.\n\nLet's make sure that we can eventually be able to do so by teaching the\nclients and servers that feature words consist of non whitespace\nletters. This parser also allows us to later add features with parameters\ne.g. \"feature=1.5\" (parameter values need to be quoted for whitespaces,\nbut we will worry about the detauls when we do introduce them).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/receive-pack.c |    7 ++++---\n cache.h                |    1 +\n connect.c              |   23 +++++++++++++++++++++--\n upload-pack.c          |   22 +++++++++++++---------\n 4 files changed, 39 insertions(+), 14 deletions(-)\n\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex b71a1ca..927f307 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -600,11 +600,12 @@ static struct command *read_head_info(void)\n \t\trefname = line + 82;\n \t\treflen = strlen(refname);\n \t\tif (reflen + 82 < len) {\n-\t\t\tif (strstr(refname + reflen + 1, \"report-status\"))\n+\t\t\tconst char *feature_list = refname + reflen + 1;\n+\t\t\tif (parse_feature_request(feature_list, \"report-status\"))\n \t\t\t\treport_status = 1;\n-\t\t\tif (strstr(refname + reflen + 1, \"side-band-64k\"))\n+\t\t\tif (parse_feature_request(feature_list, \"side-band-64k\"))\n \t\t\t\tuse_sideband = LARGE_PACKET_MAX;\n-\t\t\tif (strstr(refname + reflen + 1, \"quiet\"))\n+\t\t\tif (parse_feature_request(feature_list, \"quiet\"))\n \t\t\t\tquiet = 1;\n \t\t}\n \t\tcmd = xcalloc(1, sizeof(struct command) + len - 80);\ndiff --git a/cache.h b/cache.h\nindex e11cf6a..2933d04 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -996,6 +996,7 @@ struct extra_have_objects {\n };\n extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match, unsigned int flags, struct extra_have_objects *);\n extern int server_supports(const char *feature);\n+extern const char *parse_feature_request(const char *features, const char *feature);\n \n extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);\n \ndiff --git a/connect.c b/connect.c\nindex 2119c3f..2184fd8 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -104,8 +104,27 @@ struct ref **get_remote_heads(int in, struct ref **list,\n \n int server_supports(const char *feature)\n {\n-\treturn server_capabilities &&\n-\t\tstrstr(server_capabilities, feature) != NULL;\n+\treturn !!parse_feature_request(server_capabilities, feature);\n+}\n+\n+const char *parse_feature_request(const char *feature_list, const char *feature)\n+{\n+\tint len;\n+\n+\tif (!feature_list)\n+\t\treturn NULL;\n+\n+\tlen = strlen(feature);\n+\twhile (*feature_list) {\n+\t\tconst char *found = strstr(feature_list, feature);\n+\t\tif (!found)\n+\t\t\treturn NULL;\n+\t\tif ((feature_list == found || isspace(found[-1])) &&\n+\t\t    (!found[len] || isspace(found[len]) || found[len] == '='))\n+\t\t\treturn found;\n+\t\tfeature_list = found + 1;\n+\t}\n+\treturn NULL;\n }\n \n int path_match(const char *path, int nr, char **match)\ndiff --git a/upload-pack.c b/upload-pack.c\nindex ce5cbbe..a47a556 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -509,6 +509,7 @@ static void receive_needs(void)\n \t\twrite_str_in_full(debug_fd, \"#S\\n\");\n \tfor (;;) {\n \t\tstruct object *o;\n+\t\tconst char *features;\n \t\tunsigned char sha1_buf[20];\n \t\tlen = packet_read_line(0, line, sizeof(line));\n \t\treset_timeout();\n@@ -540,23 +541,26 @@ static void receive_needs(void)\n \t\t    get_sha1_hex(line+5, sha1_buf))\n \t\t\tdie(\"git upload-pack: protocol error, \"\n \t\t\t    \"expected to get sha, not '%s'\", line);\n-\t\tif (strstr(line+45, \"multi_ack_detailed\"))\n+\n+\t\tfeatures = line + 45;\n+\n+\t\tif (parse_feature_request(features, \"multi_ack_detailed\"))\n \t\t\tmulti_ack = 2;\n-\t\telse if (strstr(line+45, \"multi_ack\"))\n+\t\telse if (parse_feature_request(features, \"multi_ack\"))\n \t\t\tmulti_ack = 1;\n-\t\tif (strstr(line+45, \"no-done\"))\n+\t\tif (parse_feature_request(features, \"no-done\"))\n \t\t\tno_done = 1;\n-\t\tif (strstr(line+45, \"thin-pack\"))\n+\t\tif (parse_feature_request(features, \"thin-pack\"))\n \t\t\tuse_thin_pack = 1;\n-\t\tif (strstr(line+45, \"ofs-delta\"))\n+\t\tif (parse_feature_request(features, \"ofs-delta\"))\n \t\t\tuse_ofs_delta = 1;\n-\t\tif (strstr(line+45, \"side-band-64k\"))\n+\t\tif (parse_feature_request(features, \"side-band-64k\"))\n \t\t\tuse_sideband = LARGE_PACKET_MAX;\n-\t\telse if (strstr(line+45, \"side-band\"))\n+\t\telse if (parse_feature_request(features, \"side-band\"))\n \t\t\tuse_sideband = DEFAULT_PACKET_MAX;\n-\t\tif (strstr(line+45, \"no-progress\"))\n+\t\tif (parse_feature_request(features, \"no-progress\"))\n \t\t\tno_progress = 1;\n-\t\tif (strstr(line+45, \"include-tag\"))\n+\t\tif (parse_feature_request(features, \"include-tag\"))\n \t\t\tuse_include_tag = 1;\n \n \t\t/* We have sent all our refs already, and the other end\n-- \n1.7.7.rc0.175.gb3212\n"},{"id":"174859","messageId":"7v62l7crpg.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"1315067656-2846-4-git-send-email-drizzd@aon.at","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-05T08:35:07Z","receivedAt":"2011-09-05T08:35:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hmm, with this whole series merged to 'pu', I somehow am getting this\nerror:\n\n$ make -j8 \\\n    DEFAULT_TEST_TARGET=prove \\\n    GIT_PROVE_OPTS=-j8 \\\n    T=t5541-http-push.sh test\n*** prove ***\nt5541-http-push.sh .. All 1 subtests passed \n\nTest Summary Report\n-------------------\nt5541-http-push.sh (Wstat: 0 Tests: 1 Failed: 0)\n  Parse errors: No plan found in TAP output\nFiles=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.06 cusr  0.01 csys =  0.09 CPU)\nResult: FAIL\nmake[1]: *** [prove] Error 1\nmake[1]: Leaving directory `/srv/project/git/git.git/t'\nmake: *** [test] Error 2\n\nWithout prove (drop \"DEFAULT_TEST_TARGET=prove\" from the command line),\nI do not see the breakage.\n\n*** t5541-http-push.sh ***\nok 1 - set up terminal for tests\n# passed all 1 test(s)\n1..1 # SKIP Network testing disabled (define GIT_TEST_HTTPD to enable)\nmake aggregate-results\nmake[3]: Entering directory `/srv/project/git/git.git/t'\nfor f in test-results/t*-*.counts; do \\\n                echo \"$f\"; \\\n        done | '/bin/sh' ./aggregate-results.sh\nfixed   0\nsuccess 1\nfailed  0\nbroken  0\ntotal   1\n"},{"id":"174860","messageId":"4E6494F7.7010101@drmicha.warpmail.net","threadId":"28293","inReplyTo":"7v62l7crpg.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-05T09:23:03Z","receivedAt":"2011-09-05T09:23:03Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 05.09.2011 10:35:\n> Hmm, with this whole series merged to 'pu', I somehow am getting this\n> error:\n> \n> $ make -j8 \\\n>     DEFAULT_TEST_TARGET=prove \\\n>     GIT_PROVE_OPTS=-j8 \\\n>     T=t5541-http-push.sh test\n> *** prove ***\n> t5541-http-push.sh .. All 1 subtests passed \n> \n> Test Summary Report\n> -------------------\n> t5541-http-push.sh (Wstat: 0 Tests: 1 Failed: 0)\n>   Parse errors: No plan found in TAP output\n> Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.06 cusr  0.01 csys =  0.09 CPU)\n> Result: FAIL\n> make[1]: *** [prove] Error 1\n> make[1]: Leaving directory `/srv/project/git/git.git/t'\n> make: *** [test] Error 2\n> \n> Without prove (drop \"DEFAULT_TEST_TARGET=prove\" from the command line),\n> I do not see the breakage.\n> \n> *** t5541-http-push.sh ***\n> ok 1 - set up terminal for tests\n> # passed all 1 test(s)\n> 1..1 # SKIP Network testing disabled (define GIT_TEST_HTTPD to enable)\n> make aggregate-results\n> make[3]: Entering directory `/srv/project/git/git.git/t'\n> for f in test-results/t*-*.counts; do \\\n>                 echo \"$f\"; \\\n>         done | '/bin/sh' ./aggregate-results.sh\n> fixed   0\n> success 1\n> failed  0\n> broken  0\n> total   1\n> \n\nBeing cc'ed makes me feel guilty but I don't know what for... Anyway, in\ncase you need more test points, with pu at v1.7.7-rc0-315-g55af6ac  and\nprove I get:\n\n*** prove ***\nt5541-http-push.sh .. skipped: Network testing disabled (define\nGIT_TEST_HTTPD to enable)\nFiles=1, Tests=0,  0 wallclock secs ( 0.04 usr  0.01 sys +  0.00 cusr\n0.02 csys =  0.07 CPU)\nResult: NOTESTS\n\nPatch 3/3 does not apply (am) to pu but leaves neither changes nor\nconflicts in my wt. -3 gives a conflict which I don't know how to\nresolve without digging further, see below.\n\nMichael\n\nThe conflict in send-pack.c is simple, but what about:\n\ndiff --cc builtin/receive-pack.c\nindex 0b42e21,06c481a..0000000\n--- i/builtin/receive-pack.c\n+++ w/builtin/receive-pack.c\n@@@ -29,9 -29,9 +29,10 @@@ static int receive_fsck_objects\n  static int receive_unpack_limit = -1;\n  static int transfer_unpack_limit = -1;\n  static int unpack_limit = 100;\n +static unsigned long limit_pack_size, limit_commit_count,\nlimit_object_count;\n  static int report_status;\n  static int use_sideband;\n+ static int quiet;\n  static int prefer_ofs_delta = 1;\n  static int auto_update_server_info;\n  static int auto_gc = 1;\n@@@ -144,8 -113,10 +145,15 @@@ static int show_ref(const char *path, c\n        if (sent_capabilities)\n                packet_write(1, \"%s %s\\n\", sha1_to_hex(sha1), path);\n        else\n++<<<<<<< HEAD\n +              packet_write(1, \"%s %s%c%s\\n\",\n +                           sha1_to_hex(sha1), path, 0, capabilities());\n++=======\n+               packet_write(1, \"%s %s%c%s%s\\n\",\n+                            sha1_to_hex(sha1), path, 0,\n+                            \" report-status delete-refs side-band-64k\nquiet\",\n+                            prefer_ofs_delta ? \" ofs-delta\" : \"\");\n++>>>>>>> push: old receive-pack does not understand --quiet\n        sent_capabilities = 1;\n        return 0;\n  }\n"},{"id":"174872","messageId":"4E64DA0A.8090202@drmicha.warpmail.net","threadId":"28293","inReplyTo":"4E6494F7.7010101@drmicha.warpmail.net","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-05T14:17:46Z","receivedAt":"2011-09-05T14:17:46Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael J Gruber venit, vidit, dixit 05.09.2011 11:23:\n> Junio C Hamano venit, vidit, dixit 05.09.2011 10:35:\n>> Hmm, with this whole series merged to 'pu', I somehow am getting this\n>> error:\n>>\n>> $ make -j8 \\\n>>     DEFAULT_TEST_TARGET=prove \\\n>>     GIT_PROVE_OPTS=-j8 \\\n>>     T=t5541-http-push.sh test\n>> *** prove ***\n>> t5541-http-push.sh .. All 1 subtests passed \n>>\n>> Test Summary Report\n>> -------------------\n>> t5541-http-push.sh (Wstat: 0 Tests: 1 Failed: 0)\n>>   Parse errors: No plan found in TAP output\n>> Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.06 cusr  0.01 csys =  0.09 CPU)\n>> Result: FAIL\n>> make[1]: *** [prove] Error 1\n>> make[1]: Leaving directory `/srv/project/git/git.git/t'\n>> make: *** [test] Error 2\n>>\n>> Without prove (drop \"DEFAULT_TEST_TARGET=prove\" from the command line),\n>> I do not see the breakage.\n>>\n>> *** t5541-http-push.sh ***\n>> ok 1 - set up terminal for tests\n>> # passed all 1 test(s)\n>> 1..1 # SKIP Network testing disabled (define GIT_TEST_HTTPD to enable)\n>> make aggregate-results\n>> make[3]: Entering directory `/srv/project/git/git.git/t'\n>> for f in test-results/t*-*.counts; do \\\n>>                 echo \"$f\"; \\\n>>         done | '/bin/sh' ./aggregate-results.sh\n>> fixed   0\n>> success 1\n>> failed  0\n>> broken  0\n>> total   1\n>>\n> \n> Being cc'ed makes me feel guilty but I don't know what for... Anyway, in\n> case you need more test points, with pu at v1.7.7-rc0-315-g55af6ac  and\n> prove I get:\n> \n> *** prove ***\n> t5541-http-push.sh .. skipped: Network testing disabled (define\n> GIT_TEST_HTTPD to enable)\n> Files=1, Tests=0,  0 wallclock secs ( 0.04 usr  0.01 sys +  0.00 cusr\n> 0.02 csys =  0.07 CPU)\n> Result: NOTESTS\n> \n> Patch 3/3 does not apply (am) to pu but leaves neither changes nor\n> conflicts in my wt. -3 gives a conflict which I don't know how to\n> resolve without digging further, see below.\n> \n> Michael\n> \n> The conflict in send-pack.c is simple, but what about:\n...\n\nOK, I resolved this now, and am getting the same error as you, and am\nstumped. But for me, 1/3 introduces that problem already. In fact, the hunk\n\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -5,6 +5,7 @@\n\n test_description='test smart pushing over http via http-backend'\n . ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-terminal.sh\n\nsuffices to trigger the problem. The test run in lib-terminal increases\nthe count but the output is lost. Patch upcoming.\n\n\nMichael\n"},{"id":"174873","messageId":"e4e82f1267da3edfc600361de0041f618c31e30c.1315232475.git.git@drmicha.warpmail.net","threadId":"28293","inReplyTo":"4E64DA0A.8090202@drmicha.warpmail.net","subject":"[PATCH] t5541: avoid TAP test miscounting","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-05T14:24:06Z","receivedAt":"2011-09-05T14:24:06Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"lib-terminal.sh runs a test and thus increases the test count, but the\noutput is lost so that TAP produces a \"no plan found error\".\n\nMove the lib-terminal call after the lib-httpd and make TAP happy\n(though still leave me clueless).\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n t/t5541-http-push.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex 0dcb8df..a18265c 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -5,7 +5,6 @@\n \n test_description='test smart pushing over http via http-backend'\n . ./test-lib.sh\n-. \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n if test -n \"$NO_CURL\"; then\n \tskip_all='skipping test, git built without http support'\n@@ -15,6 +14,7 @@ fi\n ROOT_PATH=\"$PWD\"\n LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}\n . \"$TEST_DIRECTORY\"/lib-httpd.sh\n+. \"$TEST_DIRECTORY\"/lib-terminal.sh\n start_httpd\n \n test_expect_success 'setup remote repository' '\n-- \n1.7.7.rc0.328.g9d6c7\n"},{"id":"174882","messageId":"7vwrdmbx76.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"4E6494F7.7010101@drmicha.warpmail.net","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-05T19:34:05Z","receivedAt":"2011-09-05T19:34:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Being cc'ed makes me feel guilty but I don't know what for...\n\nNo guilt involved. 28d836c (test: allow running the tests under \"prove\",\n2010-10-14) made you a good _suspect_ for having more clues than I do to\nresolve it, iow, it was asking for help, not pointing any finger.\n\nAnyhow, thanks for a quick workaround, even though I still do not\nunderstand what the issue is (that is, what is wrong with the\nt/lib-terminal helper).\n"},{"id":"174895","messageId":"4E65B7BB.8050601@drmicha.warpmail.net","threadId":"28293","inReplyTo":"7vwrdmbx76.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-06T06:03:39Z","receivedAt":"2011-09-06T06:03:39Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 05.09.2011 21:34:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> Being cc'ed makes me feel guilty but I don't know what for...\n> \n> No guilt involved. 28d836c (test: allow running the tests under \"prove\",\n> 2010-10-14) made you a good _suspect_ for having more clues than I do to\n> resolve it, iow, it was asking for help, not pointing any finger.\n\nI plead non-guilty on the account of \"prove-clue\". All evidence to the\ncontrary is fabricated ;)\n\n> Anyhow, thanks for a quick workaround, even though I still do not\n> understand what the issue is (that is, what is wrong with the\n> t/lib-terminal helper).\n\nSeriously, I use prove as my standard target because I prefer its output\nfor parallel tests, but I have no idea how to debug the test output\n(which TAP wants to parse). I've made sure that my workaround works with\nand without the httpd runs, and with -j1 and -j8. My blackbox\nunderstanding tells me that a subtest counter used to be increased and\nthe respective output quelled - maybe by a lib*.sh which used to be\nsourced after lib-terminal.sh, because after rearranging the output is\nthere.\n\nMichael\n"},{"id":"174945","messageId":"7vty8p8s8n.fsf@alter.siamese.dyndns.org","threadId":"28293","inReplyTo":"1315067656-2846-4-git-send-email-drizzd@aon.at","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-06T18:01:44Z","receivedAt":"2011-09-06T18:01:44Z","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> Commit 90a6c7d4 (propagate --quiet to send-pack/receive-pack)\n> introduced the --quiet option to receive-pack and made send-pack\n> pass that option. Older versions of receive-pack do not recognize\n> the option, however, and terminate immediately.\n>\n> This change restores backwards compatibility by adding a 'quiet'\n> capability to receive-pack.\n\nWouldn't this mean that there is no point in adding --quiet command line\noption to the receive-pack command? IOW, shouldn't parts of 90a6c7d\n(propagate --quiet to send-pack/receive-pack, 2011-07-30) be reverted?\n\nAt this late stage in the release cycle, I would rather prefer to revert\nthe whole commit and leave anything new for the next cycle.\n"},{"id":"174950","messageId":"20110906195203.GA30927@ecki","threadId":"28293","inReplyTo":"7vty8p8s8n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] push: old receive-pack does not understand --quiet","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-09-06T19:52:03Z","receivedAt":"2011-09-06T19:52:03Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Tue, Sep 06, 2011 at 11:01:44AM -0700, Junio C Hamano wrote:\n> Clemens Buchacher <drizzd@aon.at> writes:\n> \n> > Commit 90a6c7d4 (propagate --quiet to send-pack/receive-pack)\n> > introduced the --quiet option to receive-pack and made send-pack\n> > pass that option. Older versions of receive-pack do not recognize\n> > the option, however, and terminate immediately.\n> >\n> > This change restores backwards compatibility by adding a 'quiet'\n> > capability to receive-pack.\n> \n> Wouldn't this mean that there is no point in adding --quiet command line\n> option to the receive-pack command? IOW, shouldn't parts of 90a6c7d\n> (propagate --quiet to send-pack/receive-pack, 2011-07-30) be reverted?\n> \n> At this late stage in the release cycle, I would rather prefer to revert\n> the whole commit and leave anything new for the next cycle.\n\nSure, we can do that. Only then 1.7.6.1 will be broken against all\nversions except 1.7.6.1 on the server side. Right now it is only\nbroken against 1.7.6 and older versions.\n\nBut I am ok with it either way. I will have to check how much\nresolving needs to be done after the revert.\n\nClemens\n"}]}