{"thread":{"id":"38962","subject":"Clone from shallow bundle bug","startedAt":"2015-03-31T21:10:15Z","lastAt":"2015-04-02T01:26:50Z","messageCount":16,"participants":["Phillip Susi","Junio C Hamano","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"258775","messageId":"551B0D37.5070407@ubuntu.com","threadId":"38962","inReplyTo":null,"subject":"Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-03-31T21:10:15Z","receivedAt":"2015-03-31T21:10:15Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nI made a shallow clone of my repo, then used git bundle create to pack\nit all into a bundle file, then cloned from that bundle.  The initial\nshallow clone has a .git/shallow file that identifies it as a shallow\nclone ( and I guess keeps things from complaining about the missing\nhistory ), but the the repo cloned from the bundle does not, so gitk\nrun in that clone complains about not being able to find the objects\nreferenced by the oldest commit in the repo.\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJVGw03AAoJENRVrw2cjl5R4aQIAKxddA+eneEEchuygYwA8zFK\n4O+LuEXbJ09JR196Zj535jbJ3NLre8KLX8l7gxVRFQ5FscG0+ylvawAZ2VCUrl+6\ndfTXOTfzmu36GGKJ+wG7SFIIEAzjFyLk8bj5qtJgF3F3PZqkgxmBGmQskGK1Dlet\nVUqXL0IndMTDnb5//pFGyF2L5aPvBfXcC6pZAUBjKz4dl7MfFVXbuzCMe2TqN+l6\ndPPjqANGb8MiAdhoVQ69c0uI2XH9dvmpRJTOX1Yr1IMW/AvKKM/w/A9MDKkhsab3\nccgeYDUjtUioaplnMcDwkSj4jQfQedgmIUdHeMbT0WOiKvHRArlroRVcjQS8pps=\n=kPAv\n-----END PGP SIGNATURE-----\n"},{"id":"258783","messageId":"xmqqbnj8q0bm.fsf@gitster.dls.corp.google.com","threadId":"38962","inReplyTo":"551B0D37.5070407@ubuntu.com","subject":"Re: Clone from shallow bundle bug","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-31T22:17:01Z","receivedAt":"2015-03-31T22:17:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Susi <psusi@ubuntu.com> writes:\n\n> I made a shallow clone of my repo, then used git bundle create to pack\n> it all into a bundle file, then cloned from that bundle.\n\nI think the introdution of shallow clone feature broke git bundle create\nby not teaching it that its shallow boundaries are prerequisite commits\nto unbundle its contents.  IOW, the bundle created from the shallow clone\nis broken, I would think.\n"},{"id":"258808","messageId":"551B5E64.9070906@ubuntu.com","threadId":"38962","inReplyTo":"xmqqbnj8q0bm.fsf@gitster.dls.corp.google.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-01T02:56:36Z","receivedAt":"2015-04-01T02:56:36Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA512\n\nOn 03/31/2015 06:17 PM, Junio C Hamano wrote:\n> Phillip Susi <psusi@ubuntu.com> writes:\n> \n>> I made a shallow clone of my repo, then used git bundle create to\n>> pack it all into a bundle file, then cloned from that bundle.\n> \n> I think the introdution of shallow clone feature broke git bundle\n> create by not teaching it that its shallow boundaries are\n> prerequisite commits to unbundle its contents.  IOW, the bundle\n> created from the shallow clone is broken, I would think.\n\nIt seems to me that it isn't exactly broken; it just needs to put\nsomething in the bundle noting that it was built from a shallow clone,\nand then when cloning from the shallow bundle, the new clone needs its\n.git/shallow file.\n\nIn other words, the bundle contains all of the objects in the shallow\nclone, so a new shallow clone can be correctly constructed from the\nbundle, it's just that the new clone doesn't *know* it too is shallow\nand things like git log and gitk need to stop following the history\nchain when they reach the shallow point rather than complain that the\nrest of the history is missing ( which is intentional ).\n\nFor that matter, if you do create a depth limited bundle from a non\nshallow repository, then try to clone from it, the cloned repo should\nautomatically become shallow rather than complain about missing history.\n\nIn other words, any time you clone from a bundle, the clone process\nshould check if the full history is in the bundle, and if not,\nautomatically make the new repo shallow so as to avoid the error\nmessages about the missing history.\n\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQEcBAEBCgAGBQJVG15kAAoJENRVrw2cjl5RnvgH/iMyN/1U2zg+ju/teVEQIMRL\nprvC60S9/yLxSp6RmiXpN2xuGHMkn7i2y6XpM9RQdE6ETeGaIw7UaDan3r7BPTSD\n+Q9DrAM0g17IGNxvmGPiJZP7j0t2e43oTA9KM8alf6icMU/mWJgQsbtc9QFVfVkd\njsYevK1GR6ysrAHBAV6GxKfNw5yw3N+kTf9s2rKXWIFaArD0rcKJZVxiygMlhVSa\nhT4j3+n5f3n0WMDVxFzhwOaW+yrPiXF3gs1pKFX8GT5g1BtvOAEnyskSgA5nZsNB\nG53ncyyefinaaBqCvPSbcTLXmWLV8QuLBExc13BWXiVUD2rRNQr7u1ihbxWKyvU=\n=D90B\n-----END PGP SIGNATURE-----\n"},{"id":"258811","messageId":"xmqqtwx0mka8.fsf@gitster.dls.corp.google.com","threadId":"38962","inReplyTo":"551B5E64.9070906@ubuntu.com","subject":"Re: Clone from shallow bundle bug","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-01T06:31:43Z","receivedAt":"2015-04-01T06:31:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Susi <psusi@ubuntu.com> writes:\n\n> On 03/31/2015 06:17 PM, Junio C Hamano wrote:\n>> Phillip Susi <psusi@ubuntu.com> writes:\n>> \n>>> I made a shallow clone of my repo, then used git bundle create to\n>>> pack it all into a bundle file, then cloned from that bundle.\n>> \n>> I think the introdution of shallow clone feature broke git bundle\n>> create by not teaching it that its shallow boundaries are\n>> prerequisite commits to unbundle its contents.  IOW, the bundle\n>> created from the shallow clone is broken, I would think.\n>\n> It seems to me that it isn't exactly broken; it just needs to put\n> something in the bundle noting ...\n\nI think you are saying the same thing as I did without realizing ;-)\n\nThe only way a bundle can record \"something\" \"noting\" that it is an\nincomplete history, while allowing it to be read by existing\nimplementations of \"git bundle unbundle\" is to list the commits,\nbehind which there is no history available in the bundle, as\nbundle's pre-requisites.  I said that the addition of shallow repository\nsupport did not enhance \"git bundle create\" to do so, and you are\nsaying \"it just needs to put\", implying that it currently does not.\n\nNow, the only way the existing implementations of \"git bundle\nunbundle\" can extract from such a bundle with prerequisites is to\nunbundle into a repository that satisifies the prerequisites (these\nincomplete bundle files are designed as a medium for sneaker-net\nincremental updates).  I however suspect \"git clone --shallow\" from\nsuch a bundle _might_ work (I never tried it), but I wouldn't be\nsurprised if the existing implementations of bundle unpacking code\nrefused to unbundle into a repository that lacks prerequiste commits\n(i.e. making the repository a shallow-clone).\n\nAllowing \"git clone\" (without \"--shallow\") from an incomplete bundle\nfile create a shallow clone, instead of outright refusing to work or\nsilently creating a corrupt repository, might be an interesting project,\nperhaps the right size for GSoC or something like that.\n\nPatches welcome, but one thing whoever is doing such a patch needs\nto be careful about is that the pack data in the bundle is likely to\nbe a thin one---truly requiring the repository the bundle is unpacked\ninto to have the prerequisite objects.\n"},{"id":"258816","messageId":"CACsJy8C0wMFiPw1thSWN-dPVW+9N=JXDsy_HFCj=Oyu2rf40eg@mail.gmail.com","threadId":"38962","inReplyTo":"551B0D37.5070407@ubuntu.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-01T09:55:57Z","receivedAt":"2015-04-01T09:55:57Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 1, 2015 at 4:10 AM, Phillip Susi <psusi@ubuntu.com> wrote:\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n>\n> I made a shallow clone of my repo, then used git bundle create to pack\n> it all into a bundle file, then cloned from that bundle.  The initial\n> shallow clone has a .git/shallow file that identifies it as a shallow\n> clone ( and I guess keeps things from complaining about the missing\n> history ), but the the repo cloned from the bundle does not,\n\nYou made me worry a bit. We have checks in clone and fetch to make\nsure the result is \"good\" (i.e. gitk should not complain, clone/fetch\nshould report it instead). Unfortunately I tested and it seemed to\nwork as expected (i.e. clone fails)\n\n$ LANG=C ./git clone ./shallow.bundle  shallow2\nCloning into 'shallow2'...\nReceiving objects: 100% (2813/2813), 5.33 MiB | 0 bytes/s, done.\nResolving deltas: 100% (250/250), done.\nChecking connectivity... error: Could not read\n50a3ba22454e2989424d5de489de9c0f68fed5ec\nfatal: Failed to traverse parents of commit\nc73a8a63134734ddf7077d09355a10a0077ed2ca\nfatal: remote did not send all necessary objects\n\n> so gitk\n> run in that clone complains about not being able to find the objects\n> referenced by the oldest commit in the repo.\n-- \nDuy\n"},{"id":"258817","messageId":"CACsJy8AiOsSJ7QsOmpy5Ss_fKaDK1G4ONgi=jDqM_+Vrv++pkA@mail.gmail.com","threadId":"38962","inReplyTo":"xmqqtwx0mka8.fsf@gitster.dls.corp.google.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-01T10:01:33Z","receivedAt":"2015-04-01T10:01:33Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 1, 2015 at 1:31 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> The only way a bundle can record \"something\" \"noting\" that it is an\n> incomplete history, while allowing it to be read by existing\n> implementations of \"git bundle unbundle\" is to list the commits,\n> behind which there is no history available in the bundle, as\n> bundle's pre-requisites.  I said that the addition of shallow repository\n> support did not enhance \"git bundle create\" to do so, and you are\n> saying \"it just needs to put\", implying that it currently does not.\n\nAlternatively, we can record SHA-1 in the shallow file as refs whose\nname is always \".shallow\". This way \"unbundle\" can recreate the\nshallow file if it wants. Having this \"remote\" shallow file would fit\nwell in our fetch pipeline. It's harder to recreate shallow file if we\nrecord prerequisite instead: if commit A is in the shallow file, the\nones in prerequisite category would be A's parents. So we would need\nto go over the bundle to look for commits whose parents are all in\nprerequisite list. It takes more time.\n\n> Now, the only way the existing implementations of \"git bundle\n> unbundle\" can extract from such a bundle with prerequisites is to\n> unbundle into a repository that satisifies the prerequisites (these\n> incomplete bundle files are designed as a medium for sneaker-net\n> incremental updates).  I however suspect \"git clone --shallow\" from\n> such a bundle _might_ work (I never tried it), but I wouldn't be\n> surprised if the existing implementations of bundle unpacking code\n> refused to unbundle into a repository that lacks prerequiste commits\n> (i.e. making the repository a shallow-clone).\n-- \nDuy\n"},{"id":"258821","messageId":"551BEA4A.9050708@ubuntu.com","threadId":"38962","inReplyTo":"CACsJy8C0wMFiPw1thSWN-dPVW+9N=JXDsy_HFCj=Oyu2rf40eg@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-01T12:53:30Z","receivedAt":"2015-04-01T12:53:30Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 4/1/2015 5:55 AM, Duy Nguyen wrote:\n> On Wed, Apr 1, 2015 at 4:10 AM, Phillip Susi <psusi@ubuntu.com>\n> wrote:\n>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1\n>> \n>> I made a shallow clone of my repo, then used git bundle create to\n>> pack it all into a bundle file, then cloned from that bundle.\n>> The initial shallow clone has a .git/shallow file that identifies\n>> it as a shallow clone ( and I guess keeps things from complaining\n>> about the missing history ), but the the repo cloned from the\n>> bundle does not,\n> \n> You made me worry a bit. We have checks in clone and fetch to make \n> sure the result is \"good\" (i.e. gitk should not complain,\n> clone/fetch should report it instead). Unfortunately I tested and\n> it seemed to work as expected (i.e. clone fails)\n> \n> $ LANG=C ./git clone ./shallow.bundle  shallow2 Cloning into\n> 'shallow2'... Receiving objects: 100% (2813/2813), 5.33 MiB | 0\n> bytes/s, done. Resolving deltas: 100% (250/250), done. Checking\n> connectivity... error: Could not read \n> 50a3ba22454e2989424d5de489de9c0f68fed5ec fatal: Failed to traverse\n> parents of commit c73a8a63134734ddf7077d09355a10a0077ed2ca fatal:\n> remote did not send all necessary objects\n\nStrange; it works fine for me using git 1.9.4.msysgit.1, and then I\njust get the complaints from gitk.  I created the bundle with no\nprereq argument, i.e. \"git bundle create shallow.bundle\".  Did you use\na prereq argument?\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJVG+pKAAoJENRVrw2cjl5RLkMH/j0IlFsf5oEsFejLqD2fxFAJ\n8r7pZCtYFvFqMqLQivLCdU/aYCd/5F99VUtusH3NphJvxkmCaLyRwLyA1KR/AozQ\nslEXc5gmjbUg9yEBffYQ/xFPAGrizb2BblSzl6hcAZGtscLNyKvOjHttvJL+xM1+\nuY0dwHcQ97m5p3DlehjLSAHolJF+waEhS6MarACZuSbi2JBTvo3OOagyt0o46sjp\nt5v4kfRfTYD6DTlY+VPTUC56unBaVItLDfxY5d+iHGDY2o5rhl4AFWLbCh3v6ltl\nOAuVs+UPKn0kV9tIQ6EBhQKf5CooCZtbr45OVGpVLPipjQFq2QqUjVWrLMEskhw=\n=Fem/\n-----END PGP SIGNATURE-----\n"},{"id":"258822","messageId":"551BEC08.7080906@ubuntu.com","threadId":"38962","inReplyTo":"CACsJy8AiOsSJ7QsOmpy5Ss_fKaDK1G4ONgi=jDqM_+Vrv++pkA@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-01T13:00:56Z","receivedAt":"2015-04-01T13:00:56Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 4/1/2015 6:01 AM, Duy Nguyen wrote:\n> On Wed, Apr 1, 2015 at 1:31 PM, Junio C Hamano <gitster@pobox.com>\n> wrote:\n>> The only way a bundle can record \"something\" \"noting\" that it is\n>> an incomplete history, while allowing it to be read by existing \n>> implementations of \"git bundle unbundle\" is to list the commits, \n>> behind which there is no history available in the bundle, as \n>> bundle's pre-requisites.  I said that the addition of shallow\n>> repository support did not enhance \"git bundle create\" to do so,\n>> and you are saying \"it just needs to put\", implying that it\n>> currently does not.\n> \n> Alternatively, we can record SHA-1 in the shallow file as refs\n> whose name is always \".shallow\". This way \"unbundle\" can recreate\n> the shallow file if it wants. Having this \"remote\" shallow file\n> would fit well in our fetch pipeline. It's harder to recreate\n> shallow file if we record prerequisite instead: if commit A is in\n> the shallow file, the ones in prerequisite category would be A's\n> parents. So we would need to go over the bundle to look for commits\n> whose parents are all in prerequisite list. It takes more time.\n\nRight; you can't rely only on the pre-requisets as objects in the\nbundle may be deltaed against them and so they can not be unpacked\nwithout them.  The idea here is that all required objects ( and their\ndelta bases ) are present, either in the bundle, or in the local\nrepository, but if you walk the history chain you arrive at a parent\npointer to an object you don't have.  That point should automatically\nbe recorded in .git/shallow.\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJVG+wIAAoJENRVrw2cjl5Rj2UH/0AXyy63MDYhg0C7t4ljsb0U\npHo5vZyfurO2k4vd2kiUySDhIaZ7gmhkPySbPlphzqHGtvdPtyLwkYPVgqBVv7uA\nfDodTsxt64MbdFN3CNk5zh5BLDs6q1+1IjscvTlsmjCQbTz+ys+Qw1QS0zS9hSWD\n+jGDCa1x5zETniI0wJiXSSiCF6ZtFHuEJwZp5MSj257tAidibi/a0U+AHYdFwgSf\njtoUWXR2t9Xl/eN1Xkw3bjE5xQUogZYox0IuUWPvv4c4rmgxhU6SYzYftWD7Lkof\nvL2t+y1x1IhmgLaIoPz+/p/Dfeupivf6F8dS6cfyG++QIshPGq6ACZ49NRymcy0=\n=TctP\n-----END PGP SIGNATURE-----\n"},{"id":"258824","messageId":"CACsJy8C4G01LOhg13=rhkCTMGTq-NTHgG-k-kaoT9jALnd7CZw@mail.gmail.com","threadId":"38962","inReplyTo":"551BEA4A.9050708@ubuntu.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-01T13:09:55Z","receivedAt":"2015-04-01T13:09:55Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 1, 2015 at 7:53 PM, Phillip Susi <psusi@ubuntu.com> wrote:\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n>\n> On 4/1/2015 5:55 AM, Duy Nguyen wrote:\n>> On Wed, Apr 1, 2015 at 4:10 AM, Phillip Susi <psusi@ubuntu.com>\n>> wrote:\n>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1\n>>>\n>>> I made a shallow clone of my repo, then used git bundle create to\n>>> pack it all into a bundle file, then cloned from that bundle.\n>>> The initial shallow clone has a .git/shallow file that identifies\n>>> it as a shallow clone ( and I guess keeps things from complaining\n>>> about the missing history ), but the the repo cloned from the\n>>> bundle does not,\n>>\n>> You made me worry a bit. We have checks in clone and fetch to make\n>> sure the result is \"good\" (i.e. gitk should not complain,\n>> clone/fetch should report it instead). Unfortunately I tested and\n>> it seemed to work as expected (i.e. clone fails)\n>>\n>> $ LANG=C ./git clone ./shallow.bundle  shallow2 Cloning into\n>> 'shallow2'... Receiving objects: 100% (2813/2813), 5.33 MiB | 0\n>> bytes/s, done. Resolving deltas: 100% (250/250), done. Checking\n>> connectivity... error: Could not read\n>> 50a3ba22454e2989424d5de489de9c0f68fed5ec fatal: Failed to traverse\n>> parents of commit c73a8a63134734ddf7077d09355a10a0077ed2ca fatal:\n>> remote did not send all necessary objects\n>\n> Strange; it works fine for me using git 1.9.4.msysgit.1, and then I\n> just get the complaints from gitk.  I created the bundle with no\n> prereq argument, i.e. \"git bundle create shallow.bundle\".  Did you use\n> a prereq argument?\n\nNo, just your command plus a branch name. I tried v1.9.4.msysgit.1\n(but on linux, not windows), clone rejected too.\n-- \nDuy\n"},{"id":"258825","messageId":"551BF2E6.6050000@ubuntu.com","threadId":"38962","inReplyTo":"CACsJy8C4G01LOhg13=rhkCTMGTq-NTHgG-k-kaoT9jALnd7CZw@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-01T13:30:14Z","receivedAt":"2015-04-01T13:30:14Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 4/1/2015 9:09 AM, Duy Nguyen wrote:\n>> Strange; it works fine for me using git 1.9.4.msysgit.1, and then\n>> I just get the complaints from gitk.  I created the bundle with\n>> no prereq argument, i.e. \"git bundle create shallow.bundle\".  Did\n>> you use a prereq argument?\n> \n> No, just your command plus a branch name. I tried v1.9.4.msysgit.1 \n> (but on linux, not windows), clone rejected too.\n\nEven stranger... when I use a branch name, the clone fails, but not\nwhen I use a detached HEAD.\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJVG/LlAAoJENRVrw2cjl5RKtQH/2TTJ31PtG+3MQjlKjyMhhNZ\nXl/A7QSvruDEUF8V7kdyCYlN4I3EQIelMHeG0tZPWw/qnOPMMvpMvxI2xu3na0xf\nL4AopC3XPFCe2kRG4EV17Nf0QAR8zx+ARGhCzf+PzLgGlFdmMsN3TZ/8Oe3yJHSZ\n/eu+CPvmvE0N5PeC1EnPoYJwoTcBHFFI5he736OHI5PA8WtekJPQ2SZ17pZttN0p\njmZSeqoUZAe4Jeu+xfE0hYuuoVKtlkat/2GmOKrYcglyuw1+RaU31op+mKkhtGyw\nx8yq0LmJ+zMAtj3Ab5fqv0rRrjbNPYeO5uTT+lgHSU62QRPVclv8lkugRyotcMk=\n=owOK\n-----END PGP SIGNATURE-----\n"},{"id":"258826","messageId":"CACsJy8BR=JjJ_WJ+wGLk_AhpjRh+avJnRb2KmRiVx_+2cintLA@mail.gmail.com","threadId":"38962","inReplyTo":"551BF2E6.6050000@ubuntu.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-01T13:36:21Z","receivedAt":"2015-04-01T13:36:21Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Apr 1, 2015 at 8:30 PM, Phillip Susi <psusi@ubuntu.com> wrote:\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n>\n> On 4/1/2015 9:09 AM, Duy Nguyen wrote:\n>>> Strange; it works fine for me using git 1.9.4.msysgit.1, and then\n>>> I just get the complaints from gitk.  I created the bundle with\n>>> no prereq argument, i.e. \"git bundle create shallow.bundle\".  Did\n>>> you use a prereq argument?\n>>\n>> No, just your command plus a branch name. I tried v1.9.4.msysgit.1\n>> (but on linux, not windows), clone rejected too.\n>\n> Even stranger... when I use a branch name, the clone fails, but not\n> when I use a detached HEAD.\n\nThank you. I can reproduce it now. We need to plug this hole.\n-- \nDuy\n"},{"id":"258827","messageId":"551BFB6B.3080101@ubuntu.com","threadId":"38962","inReplyTo":"CACsJy8BR=JjJ_WJ+wGLk_AhpjRh+avJnRb2KmRiVx_+2cintLA@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-01T14:06:35Z","receivedAt":"2015-04-01T14:06:35Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 4/1/2015 9:36 AM, Duy Nguyen wrote:\n> Thank you. I can reproduce it now. We need to plug this hole.\n\nI'd much rather it not refuse to clone so that I can end up with a\nproper shallow clone.  At least the way it is now, when I clone the\ndetached head, I can manually add the .git/shallow file and everything\nis fine.\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJVG/trAAoJENRVrw2cjl5RTTIIAJkdte4gWrrOGA49CI0xivX7\n1FXH3tPp/Nhd7gG3MXNfozm78DS3ZWqoU4l2SUhoE3La9UJ81T2rVo9GjcR/yXeS\nV0In+JyoQX3spZdtvH18qzKCFczyeUlu260EG7mQsBFgnAHsAJW3BPA6DWEPpfJS\nU3RPGt4S7KKy2+XJAGZJgvhvwM9vndgx161Kgwwpdocv2uWmv0AZEcMzOppZQy3y\nRqWSO5iY3qRwpMiRRh9YsQsuVNpXGxwPqV5oXXFLD7yaAMqCF5qdUYz8fWNQQ1+V\n49RpGzMNHA60FP9BrvlHMCaJgFEvBT4nrpN4MCQgkelp8LOELX1kfuq9MWl1irA=\n=BmpO\n-----END PGP SIGNATURE-----\n"},{"id":"258831","messageId":"xmqqh9szn4t3.fsf@gitster.dls.corp.google.com","threadId":"38962","inReplyTo":"CACsJy8AiOsSJ7QsOmpy5Ss_fKaDK1G4ONgi=jDqM_+Vrv++pkA@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-01T17:20:40Z","receivedAt":"2015-04-01T17:20:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> Alternatively, we can record SHA-1 in the shallow file as refs whose\n> name is always \".shallow\". This way \"unbundle\" can recreate the\n> shallow file if it wants.\n\nWouldn't the extracting end care about such a name \".shallow\" being\nduplicates (if you have multiple boundaries) or not check-ref-format\nkosher?\n\nI was hoping we will have a solution for a new bundle command to\ncreate a bundle out of a shallow repository that is somehow usable\nby existing 'git bundle' implementations.  You may take a bundle out\nof a shallow repository to preserve your work on top since you made\nthe shallow clone originally, and then send it to your friend with\nexisting 'git bundle' implementation to extract it into his full\nclone to sneaker-net.\n\nAnd that is why I did not suggest such an alternative.\n"},{"id":"258842","messageId":"CACsJy8Cew0t9EZ5aVSCa-BehWz+ABRhDbtLR2cJ2K9c38QeGsA@mail.gmail.com","threadId":"38962","inReplyTo":"xmqqh9szn4t3.fsf@gitster.dls.corp.google.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-02T00:33:11Z","receivedAt":"2015-04-02T00:33:11Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Apr 2, 2015 at 12:20 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n>\n>> Alternatively, we can record SHA-1 in the shallow file as refs whose\n>> name is always \".shallow\". This way \"unbundle\" can recreate the\n>> shallow file if it wants.\n>\n> Wouldn't the extracting end care about such a name \".shallow\" being\n> duplicates (if you have multiple boundaries) or not check-ref-format\n> kosher?\n\nI think we are careful to ignore funny ref names, so it should not be\na problem. But I haven't tested this.\n\n> I was hoping we will have a solution for a new bundle command to\n> create a bundle out of a shallow repository that is somehow usable\n> by existing 'git bundle' implementations.  You may take a bundle out\n> of a shallow repository to preserve your work on top since you made\n> the shallow clone originally, and then send it to your friend with\n> existing 'git bundle' implementation to extract it into his full\n> clone to sneaker-net.\n\nOK two additional options on top of what we already have:\n\n - save .have and add extra prerequisite SHA-1.\n - create a bundle that does not hit shallow boundary in the first\nplace, roughly speaking it's \"max depth minus one\". This one does not\nhave extra .have or prerequisites\n-- \nDuy\n"},{"id":"258843","messageId":"CACsJy8AkhtG6khb6kcVfV9dZBJH1mnQbcQVC2d5LLbCTSmKTMw@mail.gmail.com","threadId":"38962","inReplyTo":"CACsJy8Cew0t9EZ5aVSCa-BehWz+ABRhDbtLR2cJ2K9c38QeGsA@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-04-02T00:35:14Z","receivedAt":"2015-04-02T00:35:14Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Apr 2, 2015 at 7:33 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> OK two additional options on top of what we already have:\n>\n>  - save .have and add extra prerequisite SHA-1.\n>  - create a bundle that does not hit shallow boundary in the first\n> place, roughly speaking it's \"max depth minus one\". This one does not\n> have extra .have or prerequisites\n\nToo fast.. the second option does need extra prerequisites.. Ignore that one.\n-- \nDuy\n"},{"id":"258846","messageId":"551C9ADA.50404@ubuntu.com","threadId":"38962","inReplyTo":"CACsJy8Cew0t9EZ5aVSCa-BehWz+ABRhDbtLR2cJ2K9c38QeGsA@mail.gmail.com","subject":"Re: Clone from shallow bundle bug","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-04-02T01:26:50Z","receivedAt":"2015-04-02T01:26:50Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA512\n\nOn 04/01/2015 08:33 PM, Duy Nguyen wrote:\n> OK two additional options on top of what we already have:\n> \n> - save .have and add extra prerequisite SHA-1. - create a bundle\n> that does not hit shallow boundary in the first place, roughly\n> speaking it's \"max depth minus one\". This one does not have extra\n> .have or prerequisites\n\nHuh?  If it is one less deep that doesn't help: the new clone will\nstill be missing history.  AFAICS, the only way to keep the new clone\nkosher is for it to have a .git/shallow file that identifies it as a\nshallow clone so that history walks stop short instead of complaining\nabout the missing history.\n\nThus, all that is needed is for the clone, when it notices that\nhistory is missing, is to create the shallow file instead of erroring\nout, telling you to fsck yourself, and rudely deleting the new clone.\n It is one thing to tell you that there is missing history, but quite\nanother to delete the repository it just created due to it missing\nhistory.\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQEcBAEBCgAGBQJVHJraAAoJENRVrw2cjl5RABEH/RW+J5eFNRL80qMVSSnYI4Wb\nRjCb5Lb1pp4PBQtGK6yJ/7lzDYptAN6aLcpMVrGiyIIJDm7KfZ6rGvhUegn37ImH\ndCelZs+XHeR1dVd05Lbn9FGgB3mg873JOb5+i/hMuuudrXhNjRy6hhFGBnVulpPP\nlySfaPMscbSH7lzqr1zxgdu4GzRLlLPzKv1ojiWGyy97iRAsN6bRy6I1/wsddKMn\nhESUlv7AdTNQxu3b3NsLGS20a9QHMpKjBxBLvOYE6ftr4yyHMkxum/+BnoASY2UB\nh5LenKnQzRwFNGiw1BDeQESqYDXpQ4yA7lpd91gsINwgVsRqg82iSen9/fszzq0=\n=shT5\n-----END PGP SIGNATURE-----\n"}]}