{"thread":{"id":"50747","subject":"\"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","startedAt":"2019-03-15T12:14:24Z","lastAt":"2019-03-16T12:15:35Z","messageCount":7,"participants":["Robert P. J. Day","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"371581","messageId":"alpine.LFD.2.21.1903150809070.26709@localhost.localdomain","threadId":"50747","inReplyTo":null,"subject":"\"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2019-03-15T12:14:18Z","receivedAt":"2019-03-15T12:14:24Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  probably doing something idiotic but i'm enumerating variations of\nshallow cloning, and tried the following:\n\n$ git clone --shallow-exclude=master https://github.com/django/django.git\nCloning into 'django'...\nfatal: the remote end hung up unexpectedly\n$\n\n  it is entirely reproducible, and some googling suggests that this\nrepresents an error at the *other* end, which in some weird way does\nnot support that clone option. that seems strange ... should this\noption work? am i using it incorrectly?\n\n  wait, hang on ... i just picked one of django's topic branches at\nrandom, and this did succeed:\n\n$ git clone --shallow-exclude=stable/2.0.x https://github.com/django/django.git\nCloning into 'django'...\nremote: Enumerating objects: 33112, done.\nremote: Counting objects: 100% (33112/33112), done.\n... etc etc ...\n$\n\nbut all this gave me was the master branch. i clearly don't understand\nwhat this option is supposed to do.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"371582","messageId":"CACsJy8DVRJ4DG6PEkFuzytOQJ7RX6GMaHd4BRQTR9N7Y9V6fqQ@mail.gmail.com","threadId":"50747","inReplyTo":"alpine.LFD.2.21.1903150809070.26709@localhost.localdomain","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-03-15T12:28:18Z","receivedAt":"2019-03-15T12:28:46Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Mar 15, 2019 at 7:17 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>\n>\n>   probably doing something idiotic but i'm enumerating variations of\n> shallow cloning, and tried the following:\n>\n> $ git clone --shallow-exclude=master https://github.com/django/django.git\n> Cloning into 'django'...\n> fatal: the remote end hung up unexpectedly\n> $\n>\n>   it is entirely reproducible, and some googling suggests that this\n> represents an error at the *other* end, which in some weird way does\n> not support that clone option. that seems strange ... should this\n> option work? am i using it incorrectly?\n>\n>   wait, hang on ... i just picked one of django's topic branches at\n> random, and this did succeed:\n\nYeah i think when you request shallow clone, by default it only gets\none branch (see --single-branch, often 'master'). So when you specify\n--shallow-exclude you essentially say 'give me master branch but\nexclude everything from master'.\n\nI should probably make it print a friendlier message than simply\nterminateing like that (it's still a guess, I haven't tried it out)\n\n> $ git clone --shallow-exclude=stable/2.0.x https://github.com/django/django.git\n> Cloning into 'django'...\n> remote: Enumerating objects: 33112, done.\n> remote: Counting objects: 100% (33112/33112), done.\n> ... etc etc ...\n> $\n>\n> but all this gave me was the master branch. i clearly don't understand\n> what this option is supposed to do.\n\nYou're saying 'give me master branch, exclude everything that is\nreachable from stable/2.0.x'. If there's nothing in common between\nmaster and this branch, you get full 'master' branch. Otherwise you\nget a shallow 'master' branch.\n\nThis option is meant to give you another way to cut the history.\nInstead of saying 'give me X latest commits' with --shallow, you could\nsay 'give me commits since this cut point' and the cut point is often\na tag, on the same branch. Using an unrelated bracnh or tag could give\nsome surprising result.\n-- \nDuy\n"},{"id":"371585","messageId":"alpine.LFD.2.21.1903150917360.27423@localhost.localdomain","threadId":"50747","inReplyTo":"CACsJy8DVRJ4DG6PEkFuzytOQJ7RX6GMaHd4BRQTR9N7Y9V6fqQ@mail.gmail.com","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2019-03-15T13:19:26Z","receivedAt":"2019-03-15T13:19:31Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Fri, 15 Mar 2019, Duy Nguyen wrote:\n\n> On Fri, Mar 15, 2019 at 7:17 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >\n> >\n> >   probably doing something idiotic but i'm enumerating variations of\n> > shallow cloning, and tried the following:\n> >\n> > $ git clone --shallow-exclude=master https://github.com/django/django.git\n> > Cloning into 'django'...\n> > fatal: the remote end hung up unexpectedly\n> > $\n> >\n> >   it is entirely reproducible, and some googling suggests that this\n> > represents an error at the *other* end, which in some weird way does\n> > not support that clone option. that seems strange ... should this\n> > option work? am i using it incorrectly?\n> >\n> >   wait, hang on ... i just picked one of django's topic branches at\n> > random, and this did succeed:\n>\n> Yeah i think when you request shallow clone, by default it only gets\n> one branch (see --single-branch, often 'master'). So when you\n> specify --shallow-exclude you essentially say 'give me master branch\n> but exclude everything from master'.\n>\n> I should probably make it print a friendlier message than simply\n> terminateing like that (it's still a guess, I haven't tried it out)\n\n  this is the first time i've played with this feature, so i'm still\nworking my way through the man page, trying to figure out the various\nvalid combinations for shallow cloning.\n\n  i notice that the SYNOPSIS for \"man git-clone\" does not contain all\nof the supported options (eg., --shallow-exclude is missing, among\nothers). is that deliberate?\n\nrday\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"371589","messageId":"CACsJy8CspqxDhOZFF7ac_63TQXvsHjTBicEPtZaUSOmaQnzs4A@mail.gmail.com","threadId":"50747","inReplyTo":"alpine.LFD.2.21.1903150917360.27423@localhost.localdomain","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-03-15T13:41:55Z","receivedAt":"2019-03-15T13:42:24Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Mar 15, 2019 at 8:19 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>   this is the first time i've played with this feature, so i'm still\n> working my way through the man page, trying to figure out the various\n> valid combinations for shallow cloning.\n>\n>   i notice that the SYNOPSIS for \"man git-clone\" does not contain all\n> of the supported options (eg., --shallow-exclude is missing, among\n> others). is that deliberate?\n\nNo. It's either laziness or giving up on adding every option in the\nSYNOPSIS. Improvements are welcome. I can see now that --single-branch\nis mentioned in --depth (the original option to make a shallow clone)\nbut not on the newer ones. My bad.\n-- \nDuy\n"},{"id":"371592","messageId":"alpine.LFD.2.21.1903151027580.29322@localhost.localdomain","threadId":"50747","inReplyTo":"CACsJy8CspqxDhOZFF7ac_63TQXvsHjTBicEPtZaUSOmaQnzs4A@mail.gmail.com","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2019-03-15T14:31:45Z","receivedAt":"2019-03-15T14:31:51Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Fri, 15 Mar 2019, Duy Nguyen wrote:\n\n> On Fri, Mar 15, 2019 at 8:19 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >   this is the first time i've played with this feature, so i'm\n> > still working my way through the man page, trying to figure out\n> > the various valid combinations for shallow cloning.\n> >\n> >   i notice that the SYNOPSIS for \"man git-clone\" does not contain\n> > all of the supported options (eg., --shallow-exclude is missing,\n> > among others). is that deliberate?\n>\n> No. It's either laziness or giving up on adding every option in the\n> SYNOPSIS. Improvements are welcome. I can see now that\n> --single-branch is mentioned in --depth (the original option to make\n> a shallow clone) but not on the newer ones. My bad.\n\n  it's fairly obvious that, when you have a git command with a\nbazillion options, it's pointless to try to include everything in the\nSYNOPSIS part of the man page -- best to just go with something like:\n\n  SYNOPSIS\n       git log [<options>] [<revision range>] [[--] <path>...]\n\n\nwhat should (IMHO) be avoided are *incomplete* synopses, as those are\nexactly the ones that can mislead the reader into thinking that's the\nfull set of options. \"man git-clone\" might be at the point of just\nreducing the synopsis.\n\n  also, i think \"man git-clone\" could really use a set of examples for\nshallow cloning. i'd offer to write it but i'm still figuring it out.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"371642","messageId":"CACsJy8AxBr1AUwsPb6FZkJ5Pn9AfooW04Gz4fsdjF6VcP87g3w@mail.gmail.com","threadId":"50747","inReplyTo":"alpine.LFD.2.21.1903151027580.29322@localhost.localdomain","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-03-16T03:43:07Z","receivedAt":"2019-03-16T03:43:37Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Mar 15, 2019 at 9:31 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n>   also, i think \"man git-clone\" could really use a set of examples for\n> shallow cloning. i'd offer to write it but i'm still figuring it out.\n\nCool. I'll give you a quick introduction to help with those examples :D\n\nSide note: there's also narrow/lazy clone (or something with the\npromisor) but I still haven't caught up with that. So none of that\nhere, but I think we should eventually have some examples/description.\n\nA shallow clone is basically a repository with commit history cut\nshort. If you have a commit though, you have full content. It's not\ncut by paths or anything.\n\n\"git clone --depth=X\" the the normal way to do this. You get a\nrepository where all branches and tags have maximum X commits deep.\nBut since the main purpose of shallow clone is redude download,\n--single-branch is made default when --depth is present, so you get\nthe default branch instead of all the branches (you would need\n--no-single-branch for that). You could see these cut points with \"git\nlog --decorate\". I think they are marked \"crafted\" or something.\n\nOnce you have made a shallow clone, you could do everything like\nusual. Local operations of course can only reach as far as the cut\npoints. Pull and push to a full clone are possible (it's even possible\nto do so to another shallow clone).\n\nWhen you \"git fetch\", the cut points remain the same, so you get more\nrecent commits and the history depth increases. If you do \"git fetch\n--depth=X\" then the cut points are adjusted so that you only have\nmaximum X commits deep for all select branches, the same way a shallow\nclone is made initially. \"git fetch --unshallow\" can be used to turn a\nshallow clone into a complete one. And I'm pretty sure you could turn\na complete one to shallow with \"git fetch --depth\".\n\nWhile --depth works fine most of the time, sometimes you want a\ndifferent way to define these shallow/cut points. --shallow-since and\n--shallow-exclude are added as the result. --shallow-since cut the\nhistory by a specific date (for all select branches).\n--shallow-exclude cuts the history by a ref (often a tag). As I\nmentioned before, it's mostly used to say \"I want a shallow clone from\n(but not including) v2.9.0\".\n\nAnd I think that's pretty much it. There's --update-shallow option but\nI can't remember when that's needed. Shallow clones may also prevent\nyou from using some optional features. Pack bitmap is one of those and\nI think probably commit graph too. It's not technical limitation, just\nlack of time/effort to support them in shallow clones.\n-- \nDuy\n"},{"id":"371651","messageId":"alpine.LFD.2.21.1903160814460.10672@localhost.localdomain","threadId":"50747","inReplyTo":"CACsJy8AxBr1AUwsPb6FZkJ5Pn9AfooW04Gz4fsdjF6VcP87g3w@mail.gmail.com","subject":"Re: \"git clone --shallow-exclude ...\", fatal: the remote end hung up unexpectedly","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2019-03-16T12:15:18Z","receivedAt":"2019-03-16T12:15:35Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Sat, 16 Mar 2019, Duy Nguyen wrote:\n\n> On Fri, Mar 15, 2019 at 9:31 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:\n> >   also, i think \"man git-clone\" could really use a set of examples for\n> > shallow cloning. i'd offer to write it but i'm still figuring it out.\n>\n> Cool. I'll give you a quick introduction to help with those examples\n> :D\n\n  ... snip ...\n\n  i can see today is going to be busy ... thanks for all that, will\nstart reading shortly.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"}]}