{"thread":{"id":"32921","subject":"Git bundles for backup and cloning: the Zaphod Beeblebrox thread","startedAt":"2013-02-17T19:28:33Z","lastAt":"2013-02-18T21:49:24Z","messageCount":3,"participants":["Alain Kalker","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"209610","messageId":"kfrb11$ugv$2@ger.gmane.org","threadId":"32921","inReplyTo":null,"subject":"Git bundles for backup and cloning: the Zaphod Beeblebrox thread","fromName":"Alain Kalker","fromEmail":"a.c.kalker@gmail.com","sentAt":"2013-02-17T19:28:33Z","receivedAt":"2013-02-17T19:28:33Z","isPatch":false,"sender":{"key":"a.c.kalker@gmail.com","avatar":null},"body":">From the current documentation for git-bundle(1), it may not be clear for \nusers unfamilliar with Git, how to create a bundle which can be used for \nbackup purposes, or, more generally, to clone to a completely new \nrepository.\n\nPhilip Oakley has posted a documentation patch some time ago, but Junio \nhas pointed out several concerns.\nRef: http://thread.gmane.org/gmane.comp.version-control.git/205887/\nfocus=205897\n\nHere's my attempt to summarize the concerns, adding some of my own, and a \npossible solution.\n\n1. \"Missing HEAD syndrome\"\n$ git bundle create <bundle> master\n-or-\n$ git bundle create <bundle> <branchname...>\n-or-\n$ git bundle create <bundle> --branches\n-then-\n$ git clone <bundle> <dir>\n\nwill be unable to checkout any files due to a missing ref for HEAD. \nThough this can be fixed by going into <dir> and doing `git checkout \n<ref>`, this is not very user-friendly.\n\n2. \"Detached HEAD syndrome\"\n$ git bundle create <bundle> HEAD\n$ git clone <bundle> <dir>\nwill checkout files alright, but leaves one in a \"detached HEAD\" state.\n \n3. \"Exploding HEAD syndrome\"\n$ git bundle create <bundle> --all\nwill add the HEAD, but will add refs from refs/remotes/* too, which is \nnot desirable when cloning, unless one sets up all the remotes (e.g. by \nrestoring .git/config) as well.\n\nFinally, my solution for backing up only the local branches of a \nrepository:\n$ git bundle create <bundle> --branches HEAD\nbut this may not be very easy for new users to figure out on their own \nunless well documented (perhaps a new flag?)\n\nAny comments or suggestions (including HHGTTG references!) are very \nwelcome.\n\n-Alain\n"},{"id":"209611","messageId":"kfrcbe$ugv$3@ger.gmane.org","threadId":"32921","inReplyTo":"kfrb11$ugv$2@ger.gmane.org","subject":"Re: Git bundles for backup and cloning: the Zaphod Beeblebrox thread","fromName":"Alain Kalker","fromEmail":"a.c.kalker@gmail.com","sentAt":"2013-02-17T19:51:10Z","receivedAt":"2013-02-17T19:51:10Z","isPatch":false,"sender":{"key":"a.c.kalker@gmail.com","avatar":null},"body":"On Sun, 17 Feb 2013 19:28:33 +0000, Alain Kalker wrote:\n\n> From the current documentation for git-bundle(1), it may not be clear\n> for users unfamilliar with Git, how to create a bundle which can be used\n> for backup purposes, or, more generally, to clone to a completely new\n> repository.\n> \n> Philip Oakley has posted a documentation patch some time ago, but Junio\n> has pointed out several concerns.\n> Ref: http://thread.gmane.org/gmane.comp.version-control.git/205887/\n> focus=205897\n> \n> Here's my attempt to summarize the concerns, adding some of my own, and\n> a possible solution.\n> \n> 1. \"Missing HEAD syndrome\"\n> $ git bundle create <bundle> master -or-\n> $ git bundle create <bundle> <branchname...>\n> -or-\n> $ git bundle create <bundle> --branches -then-\n> $ git clone <bundle> <dir>\n> \n> will be unable to checkout any files due to a missing ref for HEAD.\n> Though this can be fixed by going into <dir> and doing `git checkout\n> <ref>`, this is not very user-friendly.\n> \n> 2. \"Detached HEAD syndrome\"\n> $ git bundle create <bundle> HEAD $ git clone <bundle> <dir>\n> will checkout files alright, but leaves one in a \"detached HEAD\" state.\n>  \n> 3. \"Exploding HEAD syndrome\"\n> $ git bundle create <bundle> --all will add the HEAD, but will add refs\nfrom refs/*, including all remotes,\n> which is not desirable when cloning, unless one\n> sets up all the remotes \nas well.\n> \n> Finally, my solution for backing up only the local branches of a\n> repository:\n$ git bundle create <bundle> --branches HEAD # for backup purposes\n-or-\n$ git bundle create <bundle> master HEAD # for hosting or redistribution\n> but this may not be very\n> easy for new users to figure out on their own unless well documented\n> (perhaps a new flag?)\n> \n> Any comments or suggestions (including HHGTTG references!) are very\n> welcome.\n> \n> -Alain\n"},{"id":"209743","messageId":"E937CF00A75848FA900526903E5B9834@PhilipOakley","threadId":"32921","inReplyTo":"kfrb11$ugv$2@ger.gmane.org","subject":"Re: Git bundles for backup and cloning: the Zaphod Beeblebrox thread","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2013-02-18T21:49:24Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Alain Kalker\" <a.c.kalker@gmail.com>\nSent: Sunday, February 17, 2013 7:28 PM\n> From the current documentation for git-bundle(1), it may not be clear\n> for\n> users unfamilliar with Git, how to create a bundle which can be used\n> for\n> backup purposes, or, more generally, to clone to a completely new\n> repository.\n>\n> Philip Oakley has posted a documentation patch some time ago, but\n> Junio\n> has pointed out several concerns.\n> Ref: http://thread.gmane.org/gmane.comp.version-control.git/205887/\n> focus=205897\n>\n> Here's my attempt to summarize the concerns, adding some of my own,\n> and a\n> possible solution.\n>\n> 1. \"Missing HEAD syndrome\"\n> $ git bundle create <bundle> master\n> -or-\n> $ git bundle create <bundle> <branchname...>\n> -or-\n> $ git bundle create <bundle> --branches\n> -then-\n> $ git clone <bundle> <dir>\n>\n> will be unable to checkout any files due to a missing ref for HEAD.\n> Though this can be fixed by going into <dir> and doing `git checkout\n> <ref>`, this is not very user-friendly.\n>\n> 2. \"Detached HEAD syndrome\"\n> $ git bundle create <bundle> HEAD\n> $ git clone <bundle> <dir>\n> will checkout files alright, but leaves one in a \"detached HEAD\"\n> state.\n>\n> 3. \"Exploding HEAD syndrome\"\n> $ git bundle create <bundle> --all\n> will add the HEAD, but will add refs from refs/remotes/* too, which is\n> not desirable when cloning, unless one sets up all the remotes (e.g.\n> by\n> restoring .git/config) as well.\n>\n> Finally, my solution for backing up only the local branches of a\n> repository:\n> $ git bundle create <bundle> --branches HEAD\n> but this may not be very easy for new users to figure out on their own\n> unless well documented (perhaps a new flag?)\n\nPerhaps if you draft up a documentation patch that would fit in the\nExamples section it could be discussed. The Example section allows that\nthe various caveats can stated and be covered.\n\nIt would also be worth linking to 'git rev-parse' under the\n<git-rev-list-args> so folk would actually look it up.\n\nIt may be that the example(s) needs to include\n    --branches[=pattern]\n    --tags[=pattern]\nrather than --all. to cover Junio's points.\n\nThe --all 'question/solution' has come up a number of times so it does \nlook worth having something in the documentation. This would be \nsomething ;-)\n\n>\n> Any comments or suggestions (including HHGTTG references!) are very\n> welcome.\n>\n> -Alain\nDo use Reply-All - include any Cc's in replies.\n"}]}