{"thread":{"id":"44620","subject":"[PATCH] clone,fetch: explain the shallow-clone option a little more clearly","startedAt":"2016-12-04T22:17:00Z","lastAt":"2016-12-07T14:07:43Z","messageCount":5,"participants":["Alex Henrie","Junio C Hamano","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"306903","messageId":"20161204220359.30807-1-alexhenrie24@gmail.com","threadId":"44620","inReplyTo":null,"subject":"[PATCH] clone,fetch: explain the shallow-clone option a little more clearly","fromName":"Alex Henrie","fromEmail":"alexhenrie24@gmail.com","sentAt":"2016-12-04T22:03:59Z","receivedAt":"2016-12-04T22:17:00Z","isPatch":true,"sender":{"key":"alexhenrie24@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5951993?v=4"},"body":"\"deepen by excluding\" does not make sense because excluding a revision\ndoes not deepen a repository; it makes the repository more shallow.\n\nSigned-off-by: Alex Henrie <alexhenrie24@gmail.com>\n---\n builtin/clone.c | 2 +-\n builtin/fetch.c | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 6c76a6e..e3cb808 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -99,7 +99,7 @@ static struct option builtin_clone_options[] = {\n \tOPT_STRING(0, \"shallow-since\", &option_since, N_(\"time\"),\n \t\t    N_(\"create a shallow clone since a specific time\")),\n \tOPT_STRING_LIST(0, \"shallow-exclude\", &option_not, N_(\"revision\"),\n-\t\t\tN_(\"deepen history of shallow clone by excluding rev\")),\n+\t\t\tN_(\"deepen history of shallow clone, excluding rev\")),\n \tOPT_BOOL(0, \"single-branch\", &option_single_branch,\n \t\t    N_(\"clone only one branch, HEAD or --branch\")),\n \tOPT_BOOL(0, \"shallow-submodules\", &option_shallow_submodules,\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex b6a5597..fc74c84 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -122,7 +122,7 @@ static struct option builtin_fetch_options[] = {\n \tOPT_STRING(0, \"shallow-since\", &deepen_since, N_(\"time\"),\n \t\t   N_(\"deepen history of shallow repository based on time\")),\n \tOPT_STRING_LIST(0, \"shallow-exclude\", &deepen_not, N_(\"revision\"),\n-\t\t\tN_(\"deepen history of shallow clone by excluding rev\")),\n+\t\t\tN_(\"deepen history of shallow clone, excluding rev\")),\n \tOPT_INTEGER(0, \"deepen\", &deepen_relative,\n \t\t    N_(\"deepen history of shallow clone\")),\n \t{ OPTION_SET_INT, 0, \"unshallow\", &unshallow, NULL,\n-- \n2.10.2\n\n"},{"id":"306942","messageId":"xmqq37i25iy5.fsf@gitster.mtv.corp.google.com","threadId":"44620","inReplyTo":"20161204220359.30807-1-alexhenrie24@gmail.com","subject":"Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-05T18:28:34Z","receivedAt":"2016-12-05T18:28:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Henrie <alexhenrie24@gmail.com> writes:\n\n> \"deepen by excluding\" does not make sense because excluding a revision\n> does not deepen a repository; it makes the repository more shallow.\n\nI think that an intuitive way the feature should work may be:\n\n - You started with \"git fetch --depth=20\" and then later say \"I\n   have only a very short segment of the recent history, but I want\n   a history that dates back to v1.0\" with \"--shallow-exclude=v1.0\".\n   In this case, you would be deepening.\n\n - You instead started with \"git fetch --depth=20000\" that dated\n   back to v0.5.  \"--shallow-exclude=v1.0\" you say today would mean\n   \"I have very old cruft I no longer look at.  I just want my\n   history lead back to v1.0 and no earlier\".  In such a case, you\n   indeed would be making the repository shallower.\n\nI however offhand do not think the feature can be used to make the\nrepository shallower, and I agree your changes to the usage string\nprobably describe what the option does more correctly.\n\nI however suspect that the feature is simply buggy and it would\neventually want to allow to shorten the history as well.  At that\npoint we may want to work on the verb 'deepen' there, too.\n\n>\n> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>\n> ---\n>  builtin/clone.c | 2 +-\n>  builtin/fetch.c | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/clone.c b/builtin/clone.c\n> index 6c76a6e..e3cb808 100644\n> --- a/builtin/clone.c\n> +++ b/builtin/clone.c\n> @@ -99,7 +99,7 @@ static struct option builtin_clone_options[] = {\n>  \tOPT_STRING(0, \"shallow-since\", &option_since, N_(\"time\"),\n>  \t\t    N_(\"create a shallow clone since a specific time\")),\n>  \tOPT_STRING_LIST(0, \"shallow-exclude\", &option_not, N_(\"revision\"),\n> -\t\t\tN_(\"deepen history of shallow clone by excluding rev\")),\n> +\t\t\tN_(\"deepen history of shallow clone, excluding rev\")),\n>  \tOPT_BOOL(0, \"single-branch\", &option_single_branch,\n>  \t\t    N_(\"clone only one branch, HEAD or --branch\")),\n>  \tOPT_BOOL(0, \"shallow-submodules\", &option_shallow_submodules,\n> diff --git a/builtin/fetch.c b/builtin/fetch.c\n> index b6a5597..fc74c84 100644\n> --- a/builtin/fetch.c\n> +++ b/builtin/fetch.c\n> @@ -122,7 +122,7 @@ static struct option builtin_fetch_options[] = {\n>  \tOPT_STRING(0, \"shallow-since\", &deepen_since, N_(\"time\"),\n>  \t\t   N_(\"deepen history of shallow repository based on time\")),\n>  \tOPT_STRING_LIST(0, \"shallow-exclude\", &deepen_not, N_(\"revision\"),\n> -\t\t\tN_(\"deepen history of shallow clone by excluding rev\")),\n> +\t\t\tN_(\"deepen history of shallow clone, excluding rev\")),\n>  \tOPT_INTEGER(0, \"deepen\", &deepen_relative,\n>  \t\t    N_(\"deepen history of shallow clone\")),\n>  \t{ OPTION_SET_INT, 0, \"unshallow\", &unshallow, NULL,\n"},{"id":"306992","messageId":"CACsJy8Cy+iWw4NhR7B_fZhBMMYt2QxdMeFsC=++LLnrTLNWfKw@mail.gmail.com","threadId":"44620","inReplyTo":"xmqq37i25iy5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-12-06T09:34:11Z","receivedAt":"2016-12-06T09:35:18Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> I however offhand do not think the feature can be used to make the\n> repository shallower\n\nI'm pretty sure it can, though it's a waste because you should be able\nto shorten your history without talking to a remote server. But that\nno-remote shortening is not implemented yet. And you probably want an\noption to check with remote anyway to make sure the part you cut out\nis available there, no history will be lost.\n-- \nDuy\n"},{"id":"307033","messageId":"xmqqshq029o7.fsf@gitster.mtv.corp.google.com","threadId":"44620","inReplyTo":"CACsJy8Cy+iWw4NhR7B_fZhBMMYt2QxdMeFsC=++LLnrTLNWfKw@mail.gmail.com","subject":"Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-06T18:29:28Z","receivedAt":"2016-12-06T18:32:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I however offhand do not think the feature can be used to make the\n>> repository shallower\n>\n> I'm pretty sure it can,...\n\nI wrote my message after a short local testing, but it is very\npossible I botched it and reached a wrong conclusion above.\n\nIf we can use the command to make it shallower, then the phrase\n\"deepen\" would probably be what we need to be fixing in this patch:\n\n>  \tOPT_STRING_LIST(0, \"shallow-exclude\", &option_not, N_(\"revision\"),\n> -\t\t\tN_(\"deepen history of shallow clone by excluding rev\")),\n> +\t\t\tN_(\"deepen history of shallow clone, excluding rev\")),\n\nPerhaps a shorter version of:\n\n    Adjust the depth of shallow clone so that commits that are\n    decendants of the named rev are made available, while commits\n    that are ancestors of the named rev are made beyond reach.\n\nor something like that.  Here is my (somewhat botched) attempt:\n\n    Adjust shallow clone's history to be cut at the rev\n\n\n"},{"id":"307115","messageId":"CACsJy8Aug-q6uFKAHpvnvt_9ZhH85q5YcFgK4Cf1bZSnC7Khag@mail.gmail.com","threadId":"44620","inReplyTo":"xmqqshq029o7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-12-07T14:07:07Z","receivedAt":"2016-12-07T14:07:43Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Dec 7, 2016 at 1:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n>\n>> On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> I however offhand do not think the feature can be used to make the\n>>> repository shallower\n>>\n>> I'm pretty sure it can,...\n>\n> I wrote my message after a short local testing, but it is very\n> possible I botched it and reached a wrong conclusion above.\n>\n> If we can use the command to make it shallower, then the phrase\n> \"deepen\" would probably be what we need to be fixing in this patch:\n>\n>>       OPT_STRING_LIST(0, \"shallow-exclude\", &option_not, N_(\"revision\"),\n>> -                     N_(\"deepen history of shallow clone by excluding rev\")),\n>> +                     N_(\"deepen history of shallow clone, excluding rev\")),\n>\n> Perhaps a shorter version of:\n>\n>     Adjust the depth of shallow clone so that commits that are\n>     decendants of the named rev are made available, while commits\n>     that are ancestors of the named rev are made beyond reach.\n>\n> or something like that.  Here is my (somewhat botched) attempt:\n>\n>     Adjust shallow clone's history to be cut at the rev\n\nOK mine is \"exclude the given tag from local history\".\n\nBTW the clone's string could be rephrased better because we know\nthere's no local history to begin with, if we stick to any verbs that\ninvolves deepening or shortening.\n-- \nDuy\n"}]}