{"thread":{"id":"5644","subject":"git-push of new, tiny branch doing more work than necessary?","startedAt":"2006-09-21T22:29:04Z","lastAt":"2006-09-28T18:10:16Z","messageCount":5,"participants":["Carl Worth","Johannes Schindelin","Junio C Hamano","Andy Whitcroft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"27390","messageId":"87fyekkg5r.wl%cworth@cworth.org","threadId":"5644","inReplyTo":null,"subject":"git-push of new, tiny branch doing more work than necessary?","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2006-09-21T22:29:04Z","receivedAt":"2006-09-21T22:29:04Z","isPatch":false,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"I've run through something quite like the following scenario a few\ntimes lately:\n\n\tgit pull origin\n\tgit checkout -b experiment\n\t# hack a file or two\n\tgit commit -a -m \"new experiment\"\n\tgit push origin experiment\n\nWhat I expect at this point is for git to push the few newly created\nobjects out to the repository. Instead it talks about generating,\ndeltifying, transferring, and unpacking thousands of objects (see\nbelow).\n\nShouldn't the same WANT/HAVE hand shaking that makes git-fetch\nefficient be doing something similar here? Or am I just doing\nsomething wrong?\n\n-Carl\n\n$ git --version\ngit version 1.4.2.rc2.gef1d9\n$ git push cworth 8379\nupdating 'refs/heads/8379'\n  from 0000000000000000000000000000000000000000\n  to   44379202da96faf632b73cdcdd6c0a74fb4b54f4\nGenerating pack...\nDone counting 4900 objects.\nResult has 4622 objects.\nDeltifying 4622 objects.\n 100% (4622/4622) done\nUnpacking 4622 objects\nTotal 4622, written 4622 (delta 3411), reused 1259 (delta 946)\nrefs/heads/8379: 0000000000000000000000000000000000000000 ->\n44379202da96faf632b73cdcdd6c0a74fb4b54f4\n"},{"id":"27391","messageId":"Pine.LNX.4.63.0609220031570.19042@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5644","inReplyTo":"87fyekkg5r.wl%cworth@cworth.org","subject":"Re: git-push of new, tiny branch doing more work than necessary?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-09-21T22:34:56Z","receivedAt":"2006-09-21T22:34:56Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 21 Sep 2006, Carl Worth wrote:\n\n> I've run through something quite like the following scenario a few\n> times lately:\n> \n> \tgit pull origin\n> \tgit checkout -b experiment\n> \t# hack a file or two\n> \tgit commit -a -m \"new experiment\"\n> \tgit push origin experiment\n> \n> What I expect at this point is for git to push the few newly created\n> objects out to the repository. Instead it talks about generating,\n> deltifying, transferring, and unpacking thousands of objects (see\n> below).\n\nI experienced something like this, too, but did not have the time to debug \nit. But alas, some time (I think last week) it started working as expected \nagain.\n\n> git version 1.4.2.rc2.gef1d9\n\nPlease try a more recent version (yours is from Jul 27).\n\nCiao,\nDscho\n"},{"id":"27400","messageId":"7vveng7ht3.fsf@assigned-by-dhcp.cox.net","threadId":"5644","inReplyTo":"87fyekkg5r.wl%cworth@cworth.org","subject":"Re: git-push of new, tiny branch doing more work than necessary?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-22T02:31:52Z","receivedAt":"2006-09-22T02:31:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Worth <cworth@cworth.org> writes:\n\n> I've run through something quite like the following scenario a few\n> times lately:\n>\n> \tgit pull origin\n> \tgit checkout -b experiment\n> \t# hack a file or two\n> \tgit commit -a -m \"new experiment\"\n> \tgit push origin experiment\n>\n> What I expect at this point is for git to push the few newly created\n> objects out to the repository. Instead it talks about generating,\n> deltifying, transferring, and unpacking thousands of objects (see\n> below).\n>\n> Shouldn't the same WANT/HAVE hand shaking that makes git-fetch\n> efficient be doing something similar here? Or am I just doing\n> something wrong?\n\nDepending on the version of git you are running, there are two\npossibilities.\n\nThere has been a change to send-pack last week pushed out to\n\"master\", in which Andy Whitcroft fixed a problem when there are\ntons of refs on either end.  Earlier we were limiting ourselves\nto use 900 or so refs when generating the pack, but the new code\nuses all refs it knows about (so it excludes commits pointed by\nall remote refs, not just the ones that fits in the arbitrary\n900 limit).\n\nIf you are seeing problem in a pair of repository with tons of\nrefs, it may be the problem Andy fixed with the above change, so\nusing the recent \"master\" version would help you.\n\nIf you are on the other han seeing the problem to start after\ninstalling the recent \"master\", it could be that the above\nchange broke things for you.  If you do not see the problem with\nv1.4.2.1 but do see the problem with the current \"master\" that\nwould be an indication this is the case.\n\nAnother thing to watch out for is that send-pack/receive-pack\nprotocol does NOT do the full \"want/have\" conversation like\nfetch-pack/upload-pack protocol does.  It merely say \"receiving\nend has these at tips of branches and tags\", \"sending side has\nthese at tips of branches and tags\", and does not ask about\nwhat's befind the tips.  So if you are in this situation, with\nor without Andy's fix I can imagine you would see some redundant\nsending of things.\n\n - The origin repository has an ancient tag and the master\n   branch.  Nothing else.\n\n - Clone origin to victim repository. The victim repository\n   would now have origin and master (the same), and the tag.\n\n - Somebody creates a commit in the \"origin\" repository on the\n   master branch.\n\n - You create a commit on the \"master\" in the victim\n   repository.\n\n - You run send-pack in the victim repository and try to push\n   your master to the master in the origin repository.\n\nIn this case, the update is not a fast forward, so you may need\nto force it.  When you do force, send-pack running on your end\nlearns from the other end about the ancient tag and its\n\"master\", the latter of which it does not know about at all\n(because you haven't pulled from the origin).  So all it has to\nwork with as the common commit is the ancient tag -- which means\nyou would end up sending everything since that ancient tag til\nyour tip of \"master\".\n\nI do not know if that is what is happening to you in this case,\nthough.  While I think not doing the discovery harder like\nupload-pack is a bug in send-pack, it is not an issue when you\nare not forcing a non-fast forward, so it probably is a lower\npriority bug than other things.  To fix it properly I think we\nwould need a minor protocol update.\n"},{"id":"27406","messageId":"45139379.4040602@shadowen.org","threadId":"5644","inReplyTo":"Pine.LNX.4.63.0609220031570.19042@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git-push of new, tiny branch doing more work than necessary?","fromName":"Andy Whitcroft","fromEmail":"apw@shadowen.org","sentAt":"2006-09-22T07:40:41Z","receivedAt":"2006-09-22T07:40:41Z","isPatch":false,"sender":{"key":"apw@shadowen.org","avatar":"https://gravatar.com/avatar/d3088262854661a913ef35cc40fedcc270142d4461791142bc1ea0b2a4e2e147?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 21 Sep 2006, Carl Worth wrote:\n> \n>> I've run through something quite like the following scenario a few\n>> times lately:\n>>\n>> \tgit pull origin\n>> \tgit checkout -b experiment\n>> \t# hack a file or two\n>> \tgit commit -a -m \"new experiment\"\n>> \tgit push origin experiment\n>>\n>> What I expect at this point is for git to push the few newly created\n>> objects out to the repository. Instead it talks about generating,\n>> deltifying, transferring, and unpacking thousands of objects (see\n>> below).\n> \n> I experienced something like this, too, but did not have the time to debug \n> it. But alas, some time (I think last week) it started working as expected \n> again.\n\nI hope this started working again because we fixed it this time.  Two\nbugs were fixed in this area.  First any branch names over about 40\ncharacters in length were being ignored completely due to a validation\nbug.  Second in an attempt to ensure we didn't bust the 900 entry\ncommand line limit for rev-list we were restricting ourselves to 16\nremote refs as possible bases.  master now has these changes in it and I\nam no longer seeing this behavior.\n\n> \n>> git version 1.4.2.rc2.gef1d9\n> \n> Please try a more recent version (yours is from Jul 27).\n\n-apw\n"},{"id":"27912","messageId":"87zmcjhng7.wl%cworth@cworth.org","threadId":"5644","inReplyTo":"45139379.4040602@shadowen.org","subject":"Re: git-push of new, tiny branch doing more work than necessary?","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2006-09-28T18:10:16Z","receivedAt":"2006-09-28T18:10:16Z","isPatch":false,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"On Fri, 22 Sep 2006 08:40:41 +0100, Andy Whitcroft wrote:\n> I hope this started working again because we fixed it this time.  Two\n> bugs were fixed in this area.  First any branch names over about 40\n> characters in length were being ignored completely due to a validation\n> bug.  Second in an attempt to ensure we didn't bust the 900 entry\n> command line limit for rev-list we were restricting ourselves to 16\n> remote refs as possible bases.  master now has these changes in it and I\n> am no longer seeing this behavior.\n\nAha! Thanks.\n\nIt doesn't appear I had the 40-character ref problem, nor was I\nexceeding the 900 ref limit. But I was definitely well over the 16 ref\nlimit.\n\n> >> git version 1.4.2.rc2.gef1d9\n> >\n> > Please try a more recent version (yours is from Jul 27).\n\nI updated as soon as I got your reply, but just waited until I hit a\nrepeat of the use case today, (I was just too lazy to try to roll\nthings back and duplicate the exact same conditions).\n\nSure enough, things seem to be much better now (git version\n1.4.2.1.g16fd), so thanks for the fix.\n\n-Carl\n"}]}