{"thread":{"id":"6452","subject":"Meaning of \"fatal: protocol error: bad line length character\"?","startedAt":"2007-01-20T12:04:57Z","lastAt":"2007-01-23T00:53:35Z","messageCount":17,"participants":["Bill Lear","Junio C Hamano","Jakub Narebski","Shawn O. Pearce","Han-Wen Nienhuys"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32151","messageId":"17842.1385.366750.915767@lisa.zopyra.com","threadId":"6452","inReplyTo":null,"subject":"Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-20T12:04:57Z","receivedAt":"2007-01-20T12:04:57Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"[Many thanks to Junio for explaining in generous detail how to think\nproperly about branches in git's distributed model.]\n\nWe are making progress in our conversion to git, but one of our\ndevelopers, on pushing into our company repo, has encountered this\nerror:\n\n% git push\nupdating 'refs/heads/master'\n  from 6b421066e842203e383e1dc466c1cdef10de56b1\n  to   2a8e554ae0c99d44988690c9fce693b3f5f128fa\nGenerating pack...\nDone counting 61 objects.\nResult has 32 objects.\nDeltifying 32 objects.\n 100% (32/32) done\nWriting 32 objects.\n 100% (32/32) done\nTotal 32, written 32 (delta 18), reused 0 (delta 0)\nUnpacking 32 objects\nfatal: protocol error: bad line length character\n\nThe notion of fatality led him to think, quite plausibly, that\nsomething very bad had happened with his push.  However, we can find\nno evidence that anything bad really did happen.\n\nI did read through the code, and pkt-line.c seems to be the origin of\nthis, and it does seem to short-circuit the read of the packet if this\nerror is encountered.  Of course, I have no idea what this really\nmeans...\n\nCould someone please explain what this error means, and how to deal\nwith it?\n\nThank you.\n\n\nBill\n"},{"id":"32164","messageId":"7vk5zh7b7d.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"17842.1385.366750.915767@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-20T19:24:54Z","receivedAt":"2007-01-20T19:24:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> % git push\n> updating 'refs/heads/master'\n>   from 6b421066e842203e383e1dc466c1cdef10de56b1\n>   to   2a8e554ae0c99d44988690c9fce693b3f5f128fa\n> Generating pack...\n> Done counting 61 objects.\n> Result has 32 objects.\n> Deltifying 32 objects.\n>  100% (32/32) done\n> Writing 32 objects.\n>  100% (32/32) done\n> Total 32, written 32 (delta 18), reused 0 (delta 0)\n> Unpacking 32 objects\n> fatal: protocol error: bad line length character\n>\n> The notion of fatality led him to think, quite plausibly, that\n> something very bad had happened with his push.  However, we can find\n> no evidence that anything bad really did happen.\n\nI've seen this \"bad line length character\" mentioned in #git and\non this list but nobody seems to have hunted down what this is.\n\n\thttp://www.gelato.unsw.edu.au/archives/git/0603/17807.html\n\nis another (Google finds some others for the error message on\nxcb list but that is about fetch-pack which is totally different\ncodepath).\n\nYour report and the above one both mention there was no harm,\nwhich is somewhat of consolation but it definitely is not a good\nsign.\n\nI've tried to reproduce it, suspecting it could be some\ninteraction with hook scripts output, without success.\n\nI've committed the following to 'master' so that when it\nreproduces we could have a slightly better clue on what we are\ngetting instead of what we are expecting.\n\ndiff --git a/pkt-line.c b/pkt-line.c\nindex b4cb7e2..369eec9 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -81,13 +81,13 @@ int packet_read_line(int fd, char *buffer, unsigned size)\n {\n \tint n;\n \tunsigned len;\n-\tchar linelen[4];\n+\tunsigned char linelen[4];\n \n-\tsafe_read(fd, linelen, 4);\n+\tsafe_read(fd, (char *)linelen, 4);\n \n \tlen = 0;\n \tfor (n = 0; n < 4; n++) {\n-\t\tunsigned char c = linelen[n];\n+\t\tchar c = linelen[n];\n \t\tlen <<= 4;\n \t\tif (c >= '0' && c <= '9') {\n \t\t\tlen += c - '0';\n@@ -101,7 +101,9 @@ int packet_read_line(int fd, char *buffer, unsigned size)\n \t\t\tlen += c - 'A' + 10;\n \t\t\tcontinue;\n \t\t}\n-\t\tdie(\"protocol error: bad line length character\");\n+\t\tdie(\"protocol error: bad line length character: \"\n+\t\t    \"%02x %02x %02x %02x\",\n+\t\t    linelen[0], linelen[1], linelen[2], linelen[3]);\n \t}\n \tif (!len)\n \t\treturn 0;\n"},{"id":"32165","messageId":"7vfya57ast.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"7vk5zh7b7d.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-20T19:33:38Z","receivedAt":"2007-01-20T19:33:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Bill Lear <rael@zopyra.com> writes:\n>\n>> % git push\n>> updating 'refs/heads/master'\n>>   from 6b421066e842203e383e1dc466c1cdef10de56b1\n>>   to   2a8e554ae0c99d44988690c9fce693b3f5f128fa\n>> Generating pack...\n>> Done counting 61 objects.\n>> Result has 32 objects.\n>> Deltifying 32 objects.\n>>  100% (32/32) done\n>> Writing 32 objects.\n>>  100% (32/32) done\n>> Total 32, written 32 (delta 18), reused 0 (delta 0)\n>> Unpacking 32 objects\n>> fatal: protocol error: bad line length character\n\nBy the way, I can see from the pack-objects output above that\nyou seem to be using git before commit 67c08ce1 (Nov 29, 2006);\nmost likely you are using the official 1.4.4.4?\n\nIs it possible for you to try git built from the tip of 'master'\nto see if it reproduces?\n"},{"id":"32166","messageId":"17842.29542.229557.460473@lisa.zopyra.com","threadId":"6452","inReplyTo":"7vfya57ast.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-20T19:54:14Z","receivedAt":"2007-01-20T19:54:14Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"We are using git 1.4.4.1, the latest I thought available, not 1.4.4.4\n(perhaps you mis-typed?).\n\nIn any case, I personally would love to try the latest build of git,\nbut I don't think I can convince the rest of the company to do so.\n\nI just got an email from one of the developers.  He seems to think\nthis is alleviated by using bash instead of tcsh.  He said he is\ndebugging his environment to see if he can isolate the problem.  I\nhave asked for more details and if I can find out more, I will\ncertainly communicate it here.\n\nIf I were to get people to agree to try the latest git build, would I\nbe able to just let the developer install and use it on his machine,\nor would I need to also update our company repo?  If the former, I\nwould have a much easier time convincing them.\n\nThanks.\n\n\nBill\n\nOn Saturday, January 20, 2007 at 11:33:38 (-0800) Junio C Hamano writes:\n>Junio C Hamano <junkio@cox.net> writes:\n>\n>> Bill Lear <rael@zopyra.com> writes:\n>>\n>>> % git push\n>>> updating 'refs/heads/master'\n>>>   from 6b421066e842203e383e1dc466c1cdef10de56b1\n>>>   to   2a8e554ae0c99d44988690c9fce693b3f5f128fa\n>>> Generating pack...\n>>> Done counting 61 objects.\n>>> Result has 32 objects.\n>>> Deltifying 32 objects.\n>>>  100% (32/32) done\n>>> Writing 32 objects.\n>>>  100% (32/32) done\n>>> Total 32, written 32 (delta 18), reused 0 (delta 0)\n>>> Unpacking 32 objects\n>>> fatal: protocol error: bad line length character\n>\n>By the way, I can see from the pack-objects output above that\n>you seem to be using git before commit 67c08ce1 (Nov 29, 2006);\n>most likely you are using the official 1.4.4.4?\n>\n>Is it possible for you to try git built from the tip of 'master'\n>to see if it reproduces?\n"},{"id":"32168","messageId":"eotso5$9fa$1@sea.gmane.org","threadId":"6452","inReplyTo":"17842.29542.229557.460473@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-20T20:07:11Z","receivedAt":"2007-01-20T20:07:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Bill Lear wrote:\n\n> We are using git 1.4.4.1, the latest I thought available, not 1.4.4.4\n> (perhaps you mis-typed?).\n\nThe latest is git 1.4.4.4. Available for example from\nhttp://kernel.org/pub/software/scm/git/\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32170","messageId":"7vbqkt78n7.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"17842.29542.229557.460473@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-20T20:20:12Z","receivedAt":"2007-01-20T20:20:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> We are using git 1.4.4.1, the latest I thought available, not 1.4.4.4\n> (perhaps you mis-typed?).\n>\n> In any case, I personally would love to try the latest build of git,\n> but I don't think I can convince the rest of the company to do so.\n>\n> I just got an email from one of the developers.  He seems to think\n> this is alleviated by using bash instead of tcsh.\n\nHeh, you'll never know what you would get until you ask.  I\ntemporarily run chsh on myself to use tcsh as my login shell,\nand sure enough I am getting the error.\n\nfatal: protocol error: bad line length character: 75 70 64 61\n\nIt reads \"u p d a\"; most likely the command name we are running,\nwhich is \"update\".  I think it is spitting out an error message\nor something silly like that saying \"update hook is not\nexecutable\".  Let me dig a bit further and report later.\n\nThis is with my previous patch; you do not have to update to\n1.5.0-rc1 -- it would not fix anything in this area.\n"},{"id":"32172","messageId":"7v7ivh77md.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"7vbqkt78n7.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-20T20:42:18Z","receivedAt":"2007-01-20T20:42:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Bill Lear <rael@zopyra.com> writes:\n>\n>> We are using git 1.4.4.1, the latest I thought available, not 1.4.4.4\n>> (perhaps you mis-typed?).\n>>\n>> In any case, I personally would love to try the latest build of git,\n>> but I don't think I can convince the rest of the company to do so.\n>>\n>> I just got an email from one of the developers.  He seems to think\n>> this is alleviated by using bash instead of tcsh.\n>\n> Heh, you'll never know what you would get until you ask.  I\n> temporarily run chsh on myself to use tcsh as my login shell,\n> and sure enough I am getting the error.\n>\n> fatal: protocol error: bad line length character: 75 70 64 61\n>\n> It reads \"u p d a\"; most likely the command name we are running,\n> which is \"update\".  I think it is spitting out an error message\n> or something silly like that saying \"update hook is not\n> executable\".  Let me dig a bit further and report later.\n\nThat was output to stdout made from the update hook in my case.\nI do not know your setup, but if you make sure your update hook\ndoes not spit out anything to its stdout (diag can go to stderr),\nyou should be able to work it around.\n\nFunny thing is, at least in recent enough git, I think we set up\nredirection to force output from hook scripts to stderr, but I\ndo not remember when it happened.  Let's see...\n\n\t...goes and looks...\n\nThat was supposed to have been fixed with commit cd83c74c (Dec\n30, 2006), but this indicates the fix is not working at all when\nyour login shell is tcsh.\n\nHmmmmmm.....\n"},{"id":"32176","messageId":"20070120213738.GA8973@spearce.org","threadId":"6452","inReplyTo":"7v7ivh77md.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-20T21:37:38Z","receivedAt":"2007-01-20T21:37:38Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Funny thing is, at least in recent enough git, I think we set up\n> redirection to force output from hook scripts to stderr, but I\n> do not remember when it happened.  Let's see...\n> \n> \t...goes and looks...\n> \n> That was supposed to have been fixed with commit cd83c74c (Dec\n> 30, 2006), but this indicates the fix is not working at all when\n> your login shell is tcsh.\n\nDon't tell us tcsh is doing something ugly like opening the tty for\nstdout/stderr instead of using the ones it inherited from its parent.\n'cause that's just useless!\n\n-- \nShawn.\n"},{"id":"32319","messageId":"17845.2402.105688.56648@lisa.zopyra.com","threadId":"6452","inReplyTo":"7v7ivh77md.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-22T18:58:42Z","receivedAt":"2007-01-22T18:58:42Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Saturday, January 20, 2007 at 12:42:18 (-0800) Junio C Hamano writes:\n>Junio C Hamano <junkio@cox.net> writes:\n>...\n>That was output to stdout made from the update hook in my case.\n>I do not know your setup, but if you make sure your update hook\n>does not spit out anything to its stdout (diag can go to stderr),\n>you should be able to work it around.\n>\n>Funny thing is, at least in recent enough git, I think we set up\n>redirection to force output from hook scripts to stderr, but I\n>do not remember when it happened.  Let's see...\n>\n>\t...goes and looks...\n>\n>That was supposed to have been fixed with commit cd83c74c (Dec\n>30, 2006), but this indicates the fix is not working at all when\n>your login shell is tcsh. ...\n\nOne of our developers who uses bash is seeing this error in his pushes\nfrom his private repo to his public repo, through the file system.\n\nHere is one example he conveyed:\n\n% git push\nerror: remote 'refs/heads/master' is not a strict subset of local ref 'refs/heads/master'. maybe you are not up-to-date and need to pull first?\nerror: remote 'refs/heads/origin' is not a strict subset of local ref 'refs/heads/origin'. maybe you are not up-to-date and need to pull first?\nupdating 'refs/heads/fig_mt_1'\n  from 85f1ff556f95b0177e69f99d1196a2db26213812\n  to   0a5a7ac9b81a90500b9c9c44a22793890513cd5a\nGenerating pack...\nDone counting 16 objects.\nResult has 10 objects.\nDeltifying 10 objects.\n 100% (10/10) done\nWriting 10 objects.\n 100% (10/10) done\nTotal 10, written 10 (delta 6), reused 0 (delta 0)\nUnpacking 10 objects\n 100% (10/10) done\nfatal: protocol error: bad line length character\nxiphi:~/devel/fig_mt_1/fusion | fig_mt_1 % refs/heads/fig_mt_1: 85f1ff556f95b01\n77e69f99d1196a2db26213812 -> 0a5a7ac9b81a90500b9c9c44a22793890513cd5a\n\nIn this case, he forgot to limit the push to his fig_mt_1 branch, but\nlast night he did a similar push (git push origin fig_mt_1), and got\nthe same bad line length character error report.  His pushes seem to\nbe propagating, but he's a bit nervous nonetheless.\n\nHe has an active update hook in his public repo, to send notices to\nhis collaborators when his work is ready for them to pull, but we\nlooked through it and don't see any printing to stdout.\n\n\nBill\n"},{"id":"32321","messageId":"7vy7nusv52.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"17845.2402.105688.56648@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-22T19:45:29Z","receivedAt":"2007-01-22T19:45:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> He has an active update hook in his public repo, to send notices to\n> his collaborators when his work is ready for them to pull, but we\n> looked through it and don't see any printing to stdout.\n\nJust a hunch.\n\nDoes the bash start-up sequence for the user emit something to\nstdout?\n\nThe attached patch on the local side (i.e. the one that pushes)\ndumps \"garbage\" you are getting on the line from the remote\nside, to help diagnosing the problem.\n\n\ndiff --git a/pkt-line.c b/pkt-line.c\nindex b4cb7e2..9bb1c90 100644\n--- a/pkt-line.c\n+++ b/pkt-line.c\n@@ -101,6 +101,16 @@ int packet_read_line(int fd, char *buffer, unsigned size)\n \t\t\tlen += c - 'A' + 10;\n \t\t\tcontinue;\n \t\t}\n+\t\terror(\"protocol error: bad line length character\");\n+\t\tfprintf(stderr, \"<<<<<\\n%.*s\", 4, linelen);\n+\t\twhile (1) {\n+\t\t\tchar buf[1024];\n+\t\t\tint cnt = xread(fd, buf, sizeof(buf));\n+\t\t\tif (cnt <= 0)\n+\t\t\t\tbreak;\n+\t\t\tfprintf(stderr, \"%.*s\", cnt, buf);\n+\t\t}\n+\t\tfprintf(stderr, \"\\n>>>>>\\n\");\n \t\tdie(\"protocol error: bad line length character\");\n \t}\n \tif (!len)\n"},{"id":"32324","messageId":"17845.5805.290668.552757@lisa.zopyra.com","threadId":"6452","inReplyTo":"7vy7nusv52.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-22T19:55:25Z","receivedAt":"2007-01-22T19:55:25Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, January 22, 2007 at 11:45:29 (-0800) Junio C Hamano writes:\n>Bill Lear <rael@zopyra.com> writes:\n>\n>> He has an active update hook in his public repo, to send notices to\n>> his collaborators when his work is ready for them to pull, but we\n>> looked through it and don't see any printing to stdout.\n>\n>Just a hunch.\n>\n>Does the bash start-up sequence for the user emit something to\n>stdout?\n\nNot that I can see.  I logged into his machine, su root, su - <his id>,\nand nothing but a prompt came up.\n\n>The attached patch on the local side (i.e. the one that pushes)\n>dumps \"garbage\" you are getting on the line from the remote\n>side, to help diagnosing the problem. ...\n\nI have asked the developer to install this and hopefully we'll\nget some feedback soon.\n\nThank you.\n\n\nBill\n"},{"id":"32325","messageId":"7vr6tmstri.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"20070120213738.GA8973@spearce.org","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-22T20:15:13Z","receivedAt":"2007-01-22T20:15:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> Junio C Hamano <junkio@cox.net> wrote:\n>> Funny thing is, at least in recent enough git, I think we set up\n>> redirection to force output from hook scripts to stderr, but I\n>> do not remember when it happened.  Let's see...\n>> \n>> \t...goes and looks...\n>> \n>> That was supposed to have been fixed with commit cd83c74c (Dec\n>> 30, 2006), but this indicates the fix is not working at all when\n>> your login shell is tcsh.\n>\n> Don't tell us tcsh is doing something ugly like opening the tty for\n> stdout/stderr instead of using the ones it inherited from its parent.\n> 'cause that's just useless!\n\nIt turns out that this was a stupidity on the part of the tester\n(i.e. me).\n\nI let the distro to install a version of git in /usr/bin/, and\nmy .cshrc is not set up to add /home/junio/git-active/bin (I\nhave $HOME/git-{master,next,pu,maint}/bin and git-active is a\nsymlink to git-master right now -- usually it points at\ngit-next), for non-interactive session like invoking\nreceive-pack.  But my bash startup does.  The breakage I was\nseeing was _NOT_ because of differences between tcsh and bash,\nbut because the fix is fairly recent.\n\nI forced the master version of receive-pack to be used on the\nremote side using --receive-pack command line parameter, and\nthings seem to work fine with either tcsh or bash.\n\nSo, no, there might be valid reasons to hate tcsh, but this is\nnot one of them.\n"},{"id":"32343","messageId":"17845.14245.559835.112658@lisa.zopyra.com","threadId":"6452","inReplyTo":"17845.5805.290668.552757@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-22T22:16:05Z","receivedAt":"2007-01-22T22:16:05Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, January 22, 2007 at 13:55:25 (-0600) Bill Lear writes:\n>...\n>>The attached patch on the local side (i.e. the one that pushes)\n>>dumps \"garbage\" you are getting on the line from the remote\n>>side, to help diagnosing the problem. ...\n>\n>I have asked the developer to install this and hopefully we'll\n>get some feedback soon.\n\nLooks like it is our developer's fault after all.  \n\n% git push\n[...]\nUnpacking 7 objects\n 100% (7/7) done\nerror: protocol error: bad line length character\n<<<<<\nUnknown command: \"#alias\"\nrefs/heads/tau_mt_1: 0a5a7ac9b81a90500b9c9c44a22793890513cd5a -> 3d0c74c15953ad5bc6a71eefa623933163c4f05f\n[...]\n\nThe problem is that his mailer is putting out: \n\n    Unknown command: \"#alias\"\n\nwhen it gets to the mail command at the bottom of the update hook.  So,\nhe's got a bad line in his .mailrc file.\n\nI do think that some augmentation of the error output is in order,\neither as previously posted, or something fancier.  It would be even\nbetter if this sort of thing did not trip up git, though perhaps\nI don't understand enough of how the update hook and git interact.\n\n\nBill\n"},{"id":"32347","messageId":"7vireyr8t3.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"17845.14245.559835.112658@lisa.zopyra.com","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-22T22:33:12Z","receivedAt":"2007-01-22T22:33:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> Looks like it is our developer's fault after all.  \n> ...\n> I do think that some augmentation of the error output is in order,\n> either as previously posted, or something fancier.  It would be even\n> better if this sort of thing did not trip up git, though perhaps\n> I don't understand enough of how the update hook and git interact.\n\nThe updated receive-pack (was fixed with cd83c74c on Dec 30th\n2006, has been in 'master', is in 1.5.0-rc2, and will be in\n1.5.0) is supposed to make this a non-issue.  Is it possible for\nyour developer to use it?  You can have a private install of\nreceive-pack somewhere in /home/me/bin and tell git-push to use\nit with --exec=/home/me/bin/git-receive-pack.\n\nWith the fixed receive-pack, whatever the mailer says should not\nbreak the protocol exchange by leaking into it; instead, it\nshould come back and shown to stderr, just like any output to\nstderr from the hook script.\n\nThe test patch I sent you should probably not be used as-is in\nthe production, as it dumps literally everything to your\nterminal without limit, but I do agree that it helped us\ndiagnose the problem in this case.  Maybe limiting it to show\nthe first few hundred bytes would be sufficient for debugging.\n"},{"id":"32352","messageId":"45B5535E.2000808@xs4all.nl","threadId":"6452","inReplyTo":"7vk5zh7b7d.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2007-01-23T00:14:22Z","receivedAt":"2007-01-23T00:14:22Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Junio C Hamano escreveu:\n> I've seen this \"bad line length character\" mentioned in #git and\n> on this list but nobody seems to have hunted down what this is.\n> \n> \thttp://www.gelato.unsw.edu.au/archives/git/0603/17807.html\n> \n> is another (Google finds some others for the error message on\n> xcb list but that is about fetch-pack which is totally different\n> codepath).\n\nif you need another example where this is happening, the anongit\nrepo for lilypond seems to have gotten in this state as well,\n\n[hanwen@haring tmp]$ git clone git://git.sv.gnu.org/lilypond.git\nInitialized empty Git repository in /tmp/lilypond/.git/\nfatal: protocol error: bad line length character\nfetch-pack from 'git://git.sv.gnu.org/lilypond.git' failed.\n\n\npushing/pulling over ssh+git and http still work.\n  \n\n(git 1.5.0rc2, not sure what git.sv.gnu.org is running)\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"32355","messageId":"7v3b62r2r1.fsf@assigned-by-dhcp.cox.net","threadId":"6452","inReplyTo":"45B5535E.2000808@xs4all.nl","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-23T00:44:02Z","receivedAt":"2007-01-23T00:44:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Han-Wen Nienhuys <hanwen@xs4all.nl> writes:\n\n> if you need another example where this is happening, the anongit\n> repo for lilypond seems to have gotten in this state as well,\n>\n> [hanwen@haring tmp]$ git clone git://git.sv.gnu.org/lilypond.git\n> Initialized empty Git repository in /tmp/lilypond/.git/\n> fatal: protocol error: bad line length character\n> fetch-pack from 'git://git.sv.gnu.org/lilypond.git' failed.\n\nWith my debugging patch applied to peek-remote:\n\n        $ git-peek-remote git://git.sv.gnu.org/lilypond.git\n        error: protocol error: bad line length character\n        <<<<<\n        env: \n        >>>>>\n        fatal: protocol error: bad line length character\n\nSo somebody says \"env:\" immediately followed by an EOF to the\nstdout when upload-pack is invoked via git-daemon.\n\nThe first thing that happens in the fetch/clone/peek-remote\nprotocol is reading from the server side, so unfortunately there\nis no way to debug any further without having an access to their\nserver.\n"},{"id":"32356","messageId":"45B55C8F.2090601@xs4all.nl","threadId":"6452","inReplyTo":"7v3b62r2r1.fsf@assigned-by-dhcp.cox.net","subject":"Re: Meaning of \"fatal: protocol error: bad line length character\"?","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2007-01-23T00:53:35Z","receivedAt":"2007-01-23T00:53:35Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nSylvain, can you help out here? \n\nThe lilypond repo got into a state where it will no longer\nallow reading over the git:// protocol; for troubleshooting,\nwe need some info on what is happening on the GNU side of things.\n\nHan-Wen\n\nJunio C Hamano escreveu:\n> Han-Wen Nienhuys <hanwen@xs4all.nl> writes:\n> \n>> if you need another example where this is happening, the anongit\n>> repo for lilypond seems to have gotten in this state as well,\n>>\n>> [hanwen@haring tmp]$ git clone git://git.sv.gnu.org/lilypond.git\n>> Initialized empty Git repository in /tmp/lilypond/.git/\n>> fatal: protocol error: bad line length character\n>> fetch-pack from 'git://git.sv.gnu.org/lilypond.git' failed.\n> \n> With my debugging patch applied to peek-remote:\n> \n>         $ git-peek-remote git://git.sv.gnu.org/lilypond.git\n>         error: protocol error: bad line length character\n>         <<<<<\n>         env: \n>         >>>>>\n>         fatal: protocol error: bad line length character\n> \n> So somebody says \"env:\" immediately followed by an EOF to the\n> stdout when upload-pack is invoked via git-daemon.\n> \n> The first thing that happens in the fetch/clone/peek-remote\n> protocol is reading from the server side, so unfortunately there\n> is no way to debug any further without having an access to their\n> server.\n> \n\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"}]}