{"thread":{"id":"11259","subject":"[PATCH] clone: support cloning full bundles","startedAt":"2007-12-12T10:48:05Z","lastAt":"2007-12-13T09:37:34Z","messageCount":5,"participants":["Santi Béjar","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"62896","messageId":"1197456485-22909-1-git-send-email-sbejar@gmail.com","threadId":"11259","inReplyTo":null,"subject":"[PATCH] clone: support cloning full bundles","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2007-12-12T10:48:05Z","receivedAt":"2007-12-12T10:48:05Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"It still fails for incremental bundles.\n\nSigned-off-by: Santi Béjar <sbejar@gmail.com>\n---\nHi *,\n\nDoes anyone know how to create a repository from an incremental bundle?\n\nAlso, when a repo/bundle does not have a HEAD, clone does not setup the\nremote configs, is this the desired behavior? \n\nI know that Kristian is working in the C conversion, I'll rebase this\npatch on top if that is prefered. Or maybe it will not be necessary at all,\nas \"git fetch\" supports bundles.\n\nSanti\n\n git-clone.sh           |   17 +++++++++++++----\n t/t5701-clone-local.sh |   11 +++++++++++\n 2 files changed, 24 insertions(+), 4 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex ecf9d89..a4a2124 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -206,11 +206,14 @@ fi\n if base=$(get_repo_base \"$repo\"); then\n \trepo=\"$base\"\n \tlocal=yes\n+elif [ -f \"$repo\" ] ; then\n+\tcase \"$repo\" in /*);; *) repo=\"$PWD/$repo\" ; esac\n fi\n \n dir=\"$2\"\n # Try using \"humanish\" part of source repo if user didn't specify one\n [ -z \"$dir\" ] && dir=$(echo \"$repo\" | sed -e 's|/$||' -e 's|:*/*\\.git$||' -e 's|.*[/:]||g')\n+[ -f \"$dir\" ] && dir=$(expr \"$repo\" : '.*/\\([^/]*\\)\\.[^/]*')\n [ -e \"$dir\" ] && die \"destination directory '$dir' already exists.\"\n [ yes = \"$bare\" ] && unset GIT_WORK_TREE\n [ -n \"$GIT_WORK_TREE\" ] && [ -e \"$GIT_WORK_TREE\" ] &&\n@@ -359,11 +362,17 @@ yes)\n \t\tfi\n \t\t;;\n \t*)\n-\t\tcase \"$upload_pack\" in\n-\t\t'') git-fetch-pack --all -k $quiet $depth $no_progress \"$repo\";;\n-\t\t*) git-fetch-pack --all -k $quiet \"$upload_pack\" $depth $no_progress \"$repo\" ;;\n-\t\tesac >\"$GIT_DIR/CLONE_HEAD\" ||\n+\t\tif [ -f \"$repo\" ] ; then\n+\t\t\tgit bundle unbundle \"$repo\" > \"$GIT_DIR/CLONE_HEAD\" ||\n+\t\t\tdie \"unbundle from '$repo' failed.\"\n+\t\telse\n+\t\t\tcase \"$upload_pack\" in\n+\t\t\t'') git-fetch-pack --all -k $quiet $depth $no_progress \"$repo\";;\n+\t\t\t*) git-fetch-pack --all -k \\\n+\t\t\t\t$quiet \"$upload_pack\" $depth $no_progress \"$repo\" ;;\n+\t\t\tesac >\"$GIT_DIR/CLONE_HEAD\" ||\n \t\t\tdie \"fetch-pack from '$repo' failed.\"\n+\t\tfi\n \t\t;;\n \tesac\n \t;;\ndiff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh\nindex 822ac8c..a7e5a31 100755\n--- a/t/t5701-clone-local.sh\n+++ b/t/t5701-clone-local.sh\n@@ -9,6 +9,7 @@ test_expect_success 'preparing origin repository' '\n \t: >file && git add . && git commit -m1 &&\n \tgit clone --bare . a.git &&\n \tgit clone --bare . x &&\n+\tgit bundle create b1.bundle --all HEAD &&\n \ttest \"$(GIT_CONFIG=a.git/config git config --bool core.bare)\" = true &&\n \ttest \"$(GIT_CONFIG=x/config git config --bool core.bare)\" = true\n '\n@@ -63,4 +64,14 @@ test_expect_success 'Even without -l, local will make a hardlink' '\n \ttest 0 = $copied\n '\n \n+test_expect_success 'bundle clone with suffix' '\n+\tcd \"$D\" &&\n+\tgit clone b1.bundle\n+'\n+\n+test_expect_success 'bundle clone' '\n+\tcd \"$D\" &&\n+\tgit clone b1.bundle bdl1\n+'\n+\n test_done\n-- \n1.5.3.7.2094.gff6c\n"},{"id":"62902","messageId":"Pine.LNX.4.64.0712121449310.27959@racer.site","threadId":"11259","inReplyTo":"1197456485-22909-1-git-send-email-sbejar@gmail.com","subject":"Re: [PATCH] clone: support cloning full bundles","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-12T14:50:15Z","receivedAt":"2007-12-12T14:50:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 12 Dec 2007, Santi Béjar wrote:\n\n> It still fails for incremental bundles.\n\nOf course it does.  The whole point of incremental bundles is that they do \n_not_ contain all objects, but rely on some objects being present on the \n\"fetch\" side.\n\nHth,\nDscho"},{"id":"62911","messageId":"8aa486160712120721k26158972qf11c889da98572c6@mail.gmail.com","threadId":"11259","inReplyTo":"Pine.LNX.4.64.0712121449310.27959@racer.site","subject":"Re: [PATCH] clone: support cloning full bundles","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2007-12-12T15:21:10Z","receivedAt":"2007-12-12T15:21:10Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Dec 12, 2007 3:50 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Wed, 12 Dec 2007, Santi Béjar wrote:\n>\n> > It still fails for incremental bundles.\n>\n> Of course it does.  The whole point of incremental bundles is that they do\n> _not_ contain all objects, but rely on some objects being present on the\n> \"fetch\" side.\n\nI know this. But then there is no bundle equivalent of the shallow\nclones, as with:\n\ngit clone --depth <depth> <repo>\n\nSanti\n"},{"id":"62946","messageId":"Pine.LNX.4.64.0712121846070.27959@racer.site","threadId":"11259","inReplyTo":"8aa486160712120721k26158972qf11c889da98572c6@mail.gmail.com","subject":"Re: [PATCH] clone: support cloning full bundles","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-12T18:46:30Z","receivedAt":"2007-12-12T18:46:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 12 Dec 2007, Santi B?jar wrote:\n\n> On Dec 12, 2007 3:50 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > On Wed, 12 Dec 2007, Santi B?jar wrote:\n> >\n> > > It still fails for incremental bundles.\n> >\n> > Of course it does.  The whole point of incremental bundles is that \n> > they do _not_ contain all objects, but rely on some objects being \n> > present on the \"fetch\" side.\n> \n> I know this. But then there is no bundle equivalent of the shallow \n> clones, as with:\n> \n> git clone --depth <depth> <repo>\n\nAh, thanks.  Completely forgot about this.\n\nCiao,\nDscho\n"},{"id":"62998","messageId":"8aa486160712130137l29409395va2b62f5d559ca54e@mail.gmail.com","threadId":"11259","inReplyTo":"Pine.LNX.4.64.0712121846070.27959@racer.site","subject":"Re: [PATCH] clone: support cloning full bundles","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2007-12-13T09:37:34Z","receivedAt":"2007-12-13T09:37:34Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Dec 12, 2007 7:46 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Wed, 12 Dec 2007, Santi B?jar wrote:\n>\n> > On Dec 12, 2007 3:50 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > > On Wed, 12 Dec 2007, Santi B?jar wrote:\n> > >\n> > > > It still fails for incremental bundles.\n> > >\n> > > Of course it does.  The whole point of incremental bundles is that\n> > > they do _not_ contain all objects, but rely on some objects being\n> > > present on the \"fetch\" side.\n> >\n> > I know this. But then there is no bundle equivalent of the shallow\n> > clones, as with:\n> >\n> > git clone --depth <depth> <repo>\n>\n> Ah, thanks.  Completely forgot about this.\n\nBut you were right, I confused incremental and shadow. So the next step would be\n\ngit bundle create --depth <depth> ...\n\nI'll see what I can do.\n\nThanks\n"}]}