{"thread":{"id":"39389","subject":"[PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","startedAt":"2015-05-21T04:14:35Z","lastAt":"2015-05-27T19:35:25Z","messageCount":16,"participants":["Jeff King","Junio C Hamano","Johannes Schindelin","Philip Oakley","Michael Haggerty"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"261730","messageId":"20150521041435.GA18978@peff.net","threadId":"39389","inReplyTo":null,"subject":"[PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-21T04:14:35Z","receivedAt":"2015-05-21T04:14:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"In a thread a few months ago[1], we discussed the idea that the\n\"--dissociate --reference=foo\" interface was somewhat awkward for\nsomebody who just wants to optimize their clone. This is mostly due to\nthe historical development of the features. The logical interface for\nsomebody who just wants a faster clone is something like\n\n   git clone --optimize-my-clone-from=foo.git git://example.com/bar.git\n\nBut we got stuck in that thread on coming up with a decent name for the\noption. Having just read through it, I think a succinct name for the\nidea is \"seed\". That is, we seed the clone with objects from another\nrepository.\n\nThat thread also brought up the idea that we do not necessarily need to\nseed from a local repository; we could do something like:\n\n  1. Fetch from the seed repo into refs/seed/*\n\n  2. Fetch from the real clone source; the fetch is optimized by the\n     presence of refs/seed/*.\n\n  3. Delete refs/seed/*. Optionally repack to drop any objects needed\n     only by the seed refs.\n\nThis is awkward with the \"--reference\" interface, because its\nimplementation is publicly tied to the concept of alternates. Whereas\n\"--seed\" is about the end result you want; we can implement it using\nalternates or with a clone, depending on where the repo is located.\n\nThere are a few open issues with this series:\n\n  1. Assuming that \"seed\" is a reasonable verb for this concept, is\n     \"--seed=<repo>\" OK for the option?  Would \"--seed-from=<repo>\" be\n     better? (Also, the response \"bleh, seed is a terrible name\" is\n     fine, too, but only if accompanied by your own suggestion :) ).\n\n  2. My main goal here is making the concept easier to explain to users.\n     The documentation in the third patch explains \"--seed\" as an alias\n     for the other options, which probably isn't helping much. It might\n     make sense to have a patch 4/3 that explains \"--seed\" first, and\n     then explains \"--reference\" as \"like --seed, but keep the\n     relationship after the clone\". Or maybe they should just get their\n     own descriptions entirely.\n\n  3. We can't dissociate from a specific alternate, so using \"--seed\"\n     implies that all \"--reference\" options get dissociated. In this\n     series, I issue a warning in that case.  But that would be easily\n     solved if \"--seed\" used the fetch strategy described above, even\n     for local clones (which would probably still be quite fast if we\n     took clone's usual hard-link shortcut instead of actually fetching\n     from a local clone).\n\nI don't have particular plans to implement generic \"--seed\" from remotes\nanytime soon. I think this takes us a step in the right direction\ninterface-wise, and it does introduce a succinct concept and option. But\nthe abstraction does leak (e.g., in that it implies \"--dissociate\"). So\none response might be \"yes, this is a good building block, and later we\ncan extend --seed; how it works is an implementation detail\". But\nequally valid would be \"eh, I like the name and the concept, but this\nimplementation is too hacky; let's wait for somebody to implement it for\nreal\". Hence the RFC label.\n\nThe patches are:\n\n  [1/3]: clone: use OPT_STRING_LIST for --reference\n  [2/3]: clone: reorder --dissociate and --reference options\n  [3/3]: clone: add `--seed` shorthand\n\nThe third one is the interesting one, and the first two are nearby\ncleanups. Whether we pursue the third one or not, I think the first two\nare worth taking by themselves.\n\n-Peff\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/264178/focus=264234\n"},{"id":"261731","messageId":"20150521041519.GA5196@peff.net","threadId":"39389","inReplyTo":"20150521041435.GA18978@peff.net","subject":"[PATCH 1/3] clone: use OPT_STRING_LIST for --reference","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-21T04:15:19Z","receivedAt":"2015-05-21T04:15:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Not only does this save us having to implement a custom\ncallback, but it handles \"--no-reference\" in the usual way\n(to clear the list).\n\nThe generic callback does copy the string, which we don't\ntechnically need, but that should not hurt anything.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/clone.c | 13 ++-----------\n 1 file changed, 2 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 166a645..1426ef5 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -51,15 +51,6 @@ static struct string_list option_config;\n static struct string_list option_reference;\n static int option_dissociate;\n \n-static int opt_parse_reference(const struct option *opt, const char *arg, int unset)\n-{\n-\tstruct string_list *option_reference = opt->value;\n-\tif (!arg)\n-\t\treturn -1;\n-\tstring_list_append(option_reference, arg);\n-\treturn 0;\n-}\n-\n static struct option builtin_clone_options[] = {\n \tOPT__VERBOSITY(&option_verbosity),\n \tOPT_BOOL(0, \"progress\", &option_progress,\n@@ -83,8 +74,8 @@ static struct option builtin_clone_options[] = {\n \t\t    N_(\"initialize submodules in the clone\")),\n \tOPT_STRING(0, \"template\", &option_template, N_(\"template-directory\"),\n \t\t   N_(\"directory from which templates will be used\")),\n-\tOPT_CALLBACK(0 , \"reference\", &option_reference, N_(\"repo\"),\n-\t\t     N_(\"reference repository\"), &opt_parse_reference),\n+\tOPT_STRING_LIST(0, \"reference\", &option_reference, N_(\"repo\"),\n+\t\t\tN_(\"reference repository\")),\n \tOPT_STRING('o', \"origin\", &option_origin, N_(\"name\"),\n \t\t   N_(\"use <name> instead of 'origin' to track upstream\")),\n \tOPT_STRING('b', \"branch\", &option_branch, N_(\"branch\"),\n-- \n2.4.1.528.g00591e3\n"},{"id":"261732","messageId":"20150521041604.GB5196@peff.net","threadId":"39389","inReplyTo":"20150521041435.GA18978@peff.net","subject":"[PATCH 2/3] clone: reorder --dissociate and --reference options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-21T04:16:04Z","receivedAt":"2015-05-21T04:16:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"These options are intimately related, so it makes sense to\nlist them nearby in the \"-h\" output (they are already\nadjacent in the manpage).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/clone.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 1426ef5..a0ec1a9 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -76,6 +76,8 @@ static struct option builtin_clone_options[] = {\n \t\t   N_(\"directory from which templates will be used\")),\n \tOPT_STRING_LIST(0, \"reference\", &option_reference, N_(\"repo\"),\n \t\t\tN_(\"reference repository\")),\n+\tOPT_BOOL(0, \"dissociate\", &option_dissociate,\n+\t\t N_(\"use --reference only while cloning\")),\n \tOPT_STRING('o', \"origin\", &option_origin, N_(\"name\"),\n \t\t   N_(\"use <name> instead of 'origin' to track upstream\")),\n \tOPT_STRING('b', \"branch\", &option_branch, N_(\"branch\"),\n@@ -86,8 +88,6 @@ static struct option builtin_clone_options[] = {\n \t\t    N_(\"create a shallow clone of that depth\")),\n \tOPT_BOOL(0, \"single-branch\", &option_single_branch,\n \t\t    N_(\"clone only one branch, HEAD or --branch\")),\n-\tOPT_BOOL(0, \"dissociate\", &option_dissociate,\n-\t\t N_(\"use --reference only while cloning\")),\n \tOPT_STRING(0, \"separate-git-dir\", &real_git_dir, N_(\"gitdir\"),\n \t\t   N_(\"separate git dir from working tree\")),\n \tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n-- \n2.4.1.528.g00591e3\n"},{"id":"261733","messageId":"20150521041619.GC5196@peff.net","threadId":"39389","inReplyTo":"20150521041435.GA18978@peff.net","subject":"[PATCH 3/3] clone: add `--seed` shorthand","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-21T04:16:20Z","receivedAt":"2015-05-21T04:16:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The safe way to use `--reference` is to add in the recent\n`--dissociate` option, which optimizes the initial clone,\nbut does not create any obligation to avoid pruning or\ndeleting the reference repository. However, it can be rather\ntricky to explain why two options are necessary, and why\nusing `--reference` alone is unsafe.\n\nThis patch introduces a single option, `--seed`, which does\nthe right thing; we can steer users towards it rather than\nexplaining the complexities. It also provides a natural\ninterface if we later want to allow seeding from non-local\nrepositories.\n\nNote that git-repack cannot selectively dissociate from\nparticular alternates. Therefore using `--reference` and\n`--seed` together will dissociate from _all_ referenced\nrepositories. We issue a warning to the user in this case.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/git-clone.txt |  3 +++\n builtin/clone.c             | 12 +++++++++++-\n t/t5700-clone-reference.sh  |  6 ++++--\n 3 files changed, 18 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex f1f2a3f..ffeb03b 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -107,6 +107,9 @@ objects from the source repository into a pack in the cloned repository.\n \ttransfer and stop borrowing from them after a clone is made\n \tby making necessary local copies of borrowed objects.\n \n+--seed <repository>::\n+\tA convenient shorthand for `--dissociate --reference=<repository>`.\n+\n --quiet::\n -q::\n \tOperate quietly.  Progress is not reported to the standard\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex a0ec1a9..dd53bbd 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -49,6 +49,7 @@ static int option_verbosity;\n static int option_progress = -1;\n static struct string_list option_config;\n static struct string_list option_reference;\n+static struct string_list option_seed;\n static int option_dissociate;\n \n static struct option builtin_clone_options[] = {\n@@ -78,6 +79,8 @@ static struct option builtin_clone_options[] = {\n \t\t\tN_(\"reference repository\")),\n \tOPT_BOOL(0, \"dissociate\", &option_dissociate,\n \t\t N_(\"use --reference only while cloning\")),\n+\tOPT_STRING_LIST(0, \"seed\", &option_seed, N_(\"repo\"),\n+\t\t\tN_(\"reference and dissociate from repo\")),\n \tOPT_STRING('o', \"origin\", &option_origin, N_(\"name\"),\n \t\t   N_(\"use <name> instead of 'origin' to track upstream\")),\n \tOPT_STRING('b', \"branch\", &option_branch, N_(\"branch\"),\n@@ -263,6 +266,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)\n static void setup_reference(void)\n {\n \tfor_each_string_list(&option_reference, add_one_reference, NULL);\n+\tfor_each_string_list(&option_seed, add_one_reference, NULL);\n }\n \n static void copy_alternates(struct strbuf *src, struct strbuf *dst,\n@@ -884,7 +888,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tgit_config_set(key.buf, repo);\n \tstrbuf_reset(&key);\n \n-\tif (option_reference.nr)\n+\tif (option_seed.nr) {\n+\t\tif (option_reference.nr)\n+\t\t\twarning(_(\"--seed and --reference used together implies --dissociate\"));\n+\t\toption_dissociate = 1;\n+\t}\n+\n+\tif (option_reference.nr || option_seed.nr)\n \t\tsetup_reference();\n \telse if (option_dissociate) {\n \t\twarning(_(\"--dissociate given, but there is no --reference\"));\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex 3e783fc..80a794c 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -209,10 +209,12 @@ test_expect_success 'clone and dissociate from reference' '\n \t) &&\n \tgit clone --no-local --reference=P Q R &&\n \tgit clone --no-local --reference=P --dissociate Q S &&\n-\t# removing the reference P would corrupt R but not S\n+\tgit clone --no-local --seed=P Q T &&\n+\t# removing the reference P would corrupt R but not S or T\n \trm -fr P &&\n \ttest_must_fail git -C R fsck &&\n-\tgit -C S fsck\n+\tgit -C S fsck &&\n+\tgit -C T fsck\n '\n \n test_done\n-- \n2.4.1.528.g00591e3\n"},{"id":"261751","messageId":"xmqqmw0yle0y.fsf@gitster.dls.corp.google.com","threadId":"39389","inReplyTo":"20150521041435.GA18978@peff.net","subject":"Re: [PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-21T05:01:49Z","receivedAt":"2015-05-21T05:01:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> .... Having just read through it, I think a succinct name for the\n> idea is \"seed\". That is, we seed the clone with objects from another\n> repository.\n\nThat's a nice name.\n\n> That thread also brought up the idea that we do not necessarily need to\n> seed from a local repository; we could do something like:\n>\n>   1. Fetch from the seed repo into refs/seed/*\n>\n>   2. Fetch from the real clone source; the fetch is optimized by the\n>      presence of refs/seed/*.\n>\n>   3. Delete refs/seed/*. Optionally repack to drop any objects needed\n>      only by the seed refs.\n>\n> This is awkward with the \"--reference\" interface, because its\n> implementation is publicly tied to the concept of alternates. Whereas\n> \"--seed\" is about the end result you want; we can implement it using\n> alternates or with a clone, depending on where the repo is located.\n\n> There are a few open issues with this series:\n>\n>   1. Assuming that \"seed\" is a reasonable verb for this concept, is\n>      \"--seed=<repo>\" OK for the option?  Would \"--seed-from=<repo>\" be\n>      better? (Also, the response \"bleh, seed is a terrible name\" is\n>      fine, too, but only if accompanied by your own suggestion :) ).\n\nThe seed may not even have to be a repository.  A bundle file hosted\non CDN that is reachable via (resumable) wget would be another good\nway to prime the well, and it would fit with the above framework\nnicely.  Grab it, fetch from it into a temporary hierarchy and then\nrun \"fetch --prune\" against the repository you originally wanted to\nclone from.\n\n>   2. My main goal here is making the concept easier to explain to users.\n>      The documentation in the third patch explains \"--seed\" as an alias\n>      for the other options, which probably isn't helping much. It might\n>      make sense to have a patch 4/3 that explains \"--seed\" first, and\n>      then explains \"--reference\" as \"like --seed, but keep the\n>      relationship after the clone\". Or maybe they should just get their\n>      own descriptions entirely.\n>\n>   3. We can't dissociate from a specific alternate, so using \"--seed\"\n>      implies that all \"--reference\" options get dissociated. In this\n>      series, I issue a warning in that case.  But that would be easily\n>      solved if \"--seed\" used the fetch strategy described above, even\n>      for local clones (which would probably still be quite fast if we\n>      took clone's usual hard-link shortcut instead of actually fetching\n>      from a local clone).\n>\n> I don't have particular plans to implement generic \"--seed\" from remotes\n> anytime soon. I think this takes us a step in the right direction\n> interface-wise, and it does introduce a succinct concept and\n> option.\n\nYes.  I like the name, the concept and the general direction.\n"},{"id":"261752","messageId":"20150521050645.GA27478@peff.net","threadId":"39389","inReplyTo":"xmqqmw0yle0y.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-21T05:06:45Z","receivedAt":"2015-05-21T05:06:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 20, 2015 at 10:01:49PM -0700, Junio C Hamano wrote:\n\n> >   1. Assuming that \"seed\" is a reasonable verb for this concept, is\n> >      \"--seed=<repo>\" OK for the option?  Would \"--seed-from=<repo>\" be\n> >      better? (Also, the response \"bleh, seed is a terrible name\" is\n> >      fine, too, but only if accompanied by your own suggestion :) ).\n> \n> The seed may not even have to be a repository.  A bundle file hosted\n> on CDN that is reachable via (resumable) wget would be another good\n> way to prime the well, and it would fit with the above framework\n> nicely.  Grab it, fetch from it into a temporary hierarchy and then\n> run \"fetch --prune\" against the repository you originally wanted to\n> clone from.\n\nYeah, I was just looking over the list archives for the past few months,\nfor things I had marked as \"to read and think about later\"[1]. That's\nhow I recalled our prior discussion on --dissociate.\n\nAnyway, I happened upon the \"prime the clone from a bundle\" concept\nbeing discussed again recently, and had the same thought. We already\ntreat local bundles as a possible source for fetching/cloning. Once upon\na time I had some patches that would let you clone straight from a\nbundle over http (it just spooled to disk, which is not the _most_\nefficient way to do it, but trying to massage the bundle straight into a\npackfile[2] ends up every complex very quickly). I should resurrect those\npatches.\n\n-Peff\n\n[1] My \"think about later\" mailbox has ~5000 messages in it, some of\n    which are from 2010. I think I may need to just declare bankruptcy.\n\n[2] There's that word again.\n"},{"id":"261795","messageId":"8895881cd3f324d2b8a827e311296a48@www.dscho.org","threadId":"39389","inReplyTo":"20150521041619.GC5196@peff.net","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-05-21T16:05:31Z","receivedAt":"2015-05-21T16:05:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn 2015-05-21 06:16, Jeff King wrote:\n\n> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\n> index f1f2a3f..ffeb03b 100644\n> --- a/Documentation/git-clone.txt\n> +++ b/Documentation/git-clone.txt\n> @@ -107,6 +107,9 @@ objects from the source repository into a pack in\n> the cloned repository.\n>  \ttransfer and stop borrowing from them after a clone is made\n>  \tby making necessary local copies of borrowed objects.\n>  \n> +--seed <repository>::\n> +\tA convenient shorthand for `--dissociate --reference=<repository>`.\n> +\n\nSince you want to advertise this as an easier way than `--dissociate --reference=<repository>`, it might make sense to avoid sending the reader that way, too.\n\nMaybe something like\n\n--seed <repository>::\n    Fetch objects from <repository> instead of the clone URL when possible. This is useful when a (possibly partial) clone already exists locally, to avoid transferring the same objects again.\n\nCiao,\nDscho\n"},{"id":"261798","messageId":"xmqqa8wxlw7v.fsf@gitster.dls.corp.google.com","threadId":"39389","inReplyTo":"20150521050645.GA27478@peff.net","subject":"Re: [PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-21T16:41:08Z","receivedAt":"2015-05-21T16:41:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Yeah, I was just looking over the list archives for the past few months,\n> for things I had marked as \"to read and think about later\"[1].\n> ...\n> [1] My \"think about later\" mailbox has ~5000 messages in it, some of\n>     which are from 2010. I think I may need to just declare bankruptcy.\n\nWere you absolutely bored and didn't have anything better to do ;-)?\n\nThanks for sweeping the backlog.  I usually do the same myself while\nthe tree is more or less frozen first week of the new cycle waiting\nfor brown paper bag bugs to be discovered, but since we somehow kept\nmoving immediately after 2.4.0 release, I didn't have a chance to do\nthat.\n"},{"id":"261841","messageId":"3516DC60279A42188EE2AA394921FC70@PhilipOakley","threadId":"39389","inReplyTo":"8895881cd3f324d2b8a827e311296a48@www.dscho.org","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2015-05-21T19:45:18Z","receivedAt":"2015-05-21T19:45:18Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Johannes Schindelin\" <johannes.schindelin@gmx.de>\n> Hi Peff,\n>\n> On 2015-05-21 06:16, Jeff King wrote:\n>\n>> diff --git a/Documentation/git-clone.txt \n>> b/Documentation/git-clone.txt\n>> index f1f2a3f..ffeb03b 100644\n>> --- a/Documentation/git-clone.txt\n>> +++ b/Documentation/git-clone.txt\n>> @@ -107,6 +107,9 @@ objects from the source repository into a pack in\n>> the cloned repository.\n>>  transfer and stop borrowing from them after a clone is made\n>>  by making necessary local copies of borrowed objects.\n>>\n>> +--seed <repository>::\n>> + A convenient shorthand for `--dissociate --reference=<repository>`.\n>> +\n>\n> Since you want to advertise this as an easier way than \n> `--dissociate --reference=<repository>`, it might make sense to avoid \n> sending the reader that way, too.\n>\n> Maybe something like\n>\n> --seed <repository>::\n>    Fetch objects from <repository> instead of the clone URL when \n> possible. This is useful when a (possibly partial) clone already \n> exists locally, to avoid transferring the same objects again.\n>\n\nWould it be worth mentioning here that a bundle is a satisfactory \nalternative to repository?\n\n+--seed <repository|bundle>::\n+    Fetch objects from <repository> or <bundle> instead of the clone \nURL when possible. This is useful when a (possibly partial) clone \nalready exists locally, to avoid transferring the same objects again.\n\nI haven't checked if the invocation would accept a bundle filename, but \nI'm presuming it can in the same way that clone does.\n\n--\nPhilip \n"},{"id":"261884","messageId":"1be7702fa53d1705e913aff2e00eac21@www.dscho.org","threadId":"39389","inReplyTo":"3516DC60279A42188EE2AA394921FC70@PhilipOakley","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-05-22T06:37:56Z","receivedAt":"2015-05-22T06:37:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philip,\n\nOn 2015-05-21 21:45, Philip Oakley wrote:\n> From: \"Johannes Schindelin\" <johannes.schindelin@gmx.de>\n>>\n>> On 2015-05-21 06:16, Jeff King wrote:\n>>\n>>> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\n>>> index f1f2a3f..ffeb03b 100644\n>>> --- a/Documentation/git-clone.txt\n>>> +++ b/Documentation/git-clone.txt\n>>> @@ -107,6 +107,9 @@ objects from the source repository into a pack in\n>>> the cloned repository.\n>>>  transfer and stop borrowing from them after a clone is made\n>>>  by making necessary local copies of borrowed objects.\n>>>\n>>> +--seed <repository>::\n>>> + A convenient shorthand for `--dissociate --reference=<repository>`.\n>>> +\n>>\n>> Since you want to advertise this as an easier way than `--dissociate --reference=<repository>`, it might make sense to avoid sending the reader that way, too.\n>>\n>> Maybe something like\n>>\n>> --seed <repository>::\n>>    Fetch objects from <repository> instead of the clone URL when possible. This is useful when a (possibly partial) clone already exists locally, to avoid transferring the same objects again.\n>>\n> \n> Would it be worth mentioning here that a bundle is a satisfactory\n> alternative to repository?\n> \n> +--seed <repository|bundle>::\n> +    Fetch objects from <repository> or <bundle> instead of the clone\n> URL when possible. This is useful when a (possibly partial) clone\n> already exists locally, to avoid transferring the same objects again.\n> \n> I haven't checked if the invocation would accept a bundle filename,\n> but I'm presuming it can in the same way that clone does.\n\nThe proof would lie in the pudding ;-) Would you mind testing whether it works with bundles?\n\nCiao,\nDscho\n"},{"id":"261886","messageId":"20150522064922.GA27716@peff.net","threadId":"39389","inReplyTo":"1be7702fa53d1705e913aff2e00eac21@www.dscho.org","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-22T06:49:23Z","receivedAt":"2015-05-22T06:49:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 22, 2015 at 08:37:56AM +0200, Johannes Schindelin wrote:\n\n> > +--seed <repository|bundle>::\n> > +    Fetch objects from <repository> or <bundle> instead of the clone\n> > URL when possible. This is useful when a (possibly partial) clone\n> > already exists locally, to avoid transferring the same objects again.\n> > \n> > I haven't checked if the invocation would accept a bundle filename,\n> > but I'm presuming it can in the same way that clone does.\n> \n> The proof would lie in the pudding ;-) Would you mind testing whether it works with bundles?\n\nI can't imagine that it would with my patch. The implementation is based\non --reference, which is going to try to set up the bundle as an\nalternate.\n\nHaving slept on it, I really think \"--seed\" should be \"fetch from the\nseed into temp refs\", and not what I posted earlier.\n\n-Peff\n"},{"id":"261887","messageId":"20150522065022.GB27716@peff.net","threadId":"39389","inReplyTo":"8895881cd3f324d2b8a827e311296a48@www.dscho.org","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-22T06:50:22Z","receivedAt":"2015-05-22T06:50:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 21, 2015 at 06:05:31PM +0200, Johannes Schindelin wrote:\n\n> > +--seed <repository>::\n> > +\tA convenient shorthand for `--dissociate --reference=<repository>`.\n> > +\n> \n> Since you want to advertise this as an easier way than `--dissociate --reference=<repository>`, it might make sense to avoid sending the reader that way, too.\n> \n> Maybe something like\n> \n> --seed <repository>::\n>     Fetch objects from <repository> instead of the clone URL when\n>     possible. This is useful when a (possibly partial) clone already\n>     exists locally, to avoid transferring the same objects again.\n\nYeah, I agree that is much better (it's the \"4/3\" I suggested in the\ncover letter).\n\n-Peff\n"},{"id":"262018","messageId":"xmqqtwv1bxpy.fsf@gitster.dls.corp.google.com","threadId":"39389","inReplyTo":"20150522064922.GA27716@peff.net","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-24T19:07:53Z","receivedAt":"2015-05-24T19:07:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Having slept on it, I really think \"--seed\" should be \"fetch from the\n> seed into temp refs\", and not what I posted earlier.\n\nYeah, I think that is the right way to do it.\n\nAnd it happens to mesh well with the (not so well advertised but not\nso well hidden) plan to allow loaded server side to advise --seed\nfrom bundle hosted elsewhere, e.g.\n\n     * \"clone\" connects to upload-pack\n\n     * upload-pack advertises --seed=http://cdn.github.com/project.bundle\n       via capability\n\n     * \"clone\" disconnects from upload-pack, and runs (resumable)\n       wget to the seed to grab bundle.\n\n     * \"clone\" then fetches refs/*:refs/remotes/origin/* from the bundle\n\n     * \"clone\" then continues to fetch into +refs/remotes/origin/* as\n       usual, but does an equivalent of using --prune for this fetch\n       to drop anything extra/stale that the seed bundle may have\n       had.\n\n     * optionally \"clone\" can immediately \"repack\".\n\n... which I wanted to see happen in a near future.\n\nAnd that --seed thing that can name a local bundle file is a very\ngood first step toward the direction, I think.\n\nThanks.\n"},{"id":"262019","messageId":"5562646A.1080608@alum.mit.edu","threadId":"39389","inReplyTo":"20150521041435.GA18978@peff.net","subject":"Re: [PATCH/RFC 0/3] --seed as an alias for --dissociate --reference","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2015-05-24T23:53:14Z","receivedAt":"2015-05-24T23:53:14Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"Thanks for working on this. I have one little bikeshedding comment...\n\nOn 05/21/2015 06:14 AM, Jeff King wrote:\n> [...]\n> There are a few open issues with this series:\n> \n>   1. Assuming that \"seed\" is a reasonable verb for this concept, is\n>      \"--seed=<repo>\" OK for the option?  Would \"--seed-from=<repo>\" be\n>      better? (Also, the response \"bleh, seed is a terrible name\" is\n>      fine, too, but only if accompanied by your own suggestion :) ).\n\nI think \"seed\" is a pretty good name. The only downside is that \"seed\"\nsuggests that the process injects just a few seeds that are much smaller\nthan the whole. But in fact, (hopefully) this option causes the bulk of\nthe needed objects to be pre-fetched.\n\nI can't think of any name that is clearly better. Some brainstorming:\n\n* prepare -- meh\n* prime (as in \"prime the pump\"). But \"prime\" alone could have too many\nmeanings, so...\n* prime-from\n* pre-fetch or pre-fetch-from\n* pre-load or pre-load-from\n\nBTW I think \"--seed-from=<repo>\" is more self-explanatory than\n\"--seed=<repo>\".\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\n"},{"id":"262219","messageId":"20150527081909.GA10008@peff.net","threadId":"39389","inReplyTo":"xmqqtwv1bxpy.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-27T08:19:10Z","receivedAt":"2015-05-27T08:19:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, May 24, 2015 at 12:07:53PM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Having slept on it, I really think \"--seed\" should be \"fetch from the\n> > seed into temp refs\", and not what I posted earlier.\n> \n> Yeah, I think that is the right way to do it.\n\nIn the meantime, do you want to pick up patches 1 and 2? I think they\nare cleanups that stand on their own, whether we do patch 3 or not.\n\n-Peff\n"},{"id":"262252","messageId":"xmqqoal5lsoy.fsf@gitster.dls.corp.google.com","threadId":"39389","inReplyTo":"20150527081909.GA10008@peff.net","subject":"Re: [PATCH 3/3] clone: add `--seed` shorthand","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-27T19:35:25Z","receivedAt":"2015-05-27T19:35:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sun, May 24, 2015 at 12:07:53PM -0700, Junio C Hamano wrote:\n>\n>> Jeff King <peff@peff.net> writes:\n>> \n>> > Having slept on it, I really think \"--seed\" should be \"fetch from the\n>> > seed into temp refs\", and not what I posted earlier.\n>> \n>> Yeah, I think that is the right way to do it.\n>\n> In the meantime, do you want to pick up patches 1 and 2? I think they\n> are cleanups that stand on their own, whether we do patch 3 or not.\n\nThanks for reminding.  Let me take a look.\n\nThanks.\n"}]}