git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 5, 2016, 18:28 UTC
Message-ID
<xmqq37i25iy5.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20161204220359.30807-1-alexhenrie24@gmail.com>
Alex Henrie <alexhenrie24@gmail.com> writes:
> "deepen by excluding" does not make sense because excluding a revision
> does not deepen a repository; it makes the repository more shallow.
I think that an intuitive way the feature should work may be:
 - You started with "git fetch --depth=20" and then later say "I
   have only a very short segment of the recent history, but I want
   a history that dates back to v1.0" with "--shallow-exclude=v1.0".
   In this case, you would be deepening.
 - You instead started with "git fetch --depth=20000" that dated
   back to v0.5.  "--shallow-exclude=v1.0" you say today would mean
   "I have very old cruft I no longer look at.  I just want my
   history lead back to v1.0 and no earlier".  In such a case, you
   indeed would be making the repository shallower.

I however offhand do not think the feature can be used to make the repository shallower, and I agree your changes to the usage string probably describe what the option does more correctly.

I however suspect that the feature is simply buggy and it would eventually want to allow to shorten the history as well. At that point we may want to work on the verb 'deepen' there, too.

Show 33 quoted lines
>
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
>  builtin/clone.c | 2 +-
>  builtin/fetch.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 6c76a6e..e3cb808 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -99,7 +99,7 @@ static struct option builtin_clone_options[] = {
>  	OPT_STRING(0, "shallow-since", &option_since, N_("time"),
>  		    N_("create a shallow clone since a specific time")),
>  	OPT_STRING_LIST(0, "shallow-exclude", &option_not, N_("revision"),
> -			N_("deepen history of shallow clone by excluding rev")),
> +			N_("deepen history of shallow clone, excluding rev")),
>  	OPT_BOOL(0, "single-branch", &option_single_branch,
>  		    N_("clone only one branch, HEAD or --branch")),
>  	OPT_BOOL(0, "shallow-submodules", &option_shallow_submodules,
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index b6a5597..fc74c84 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -122,7 +122,7 @@ static struct option builtin_fetch_options[] = {
>  	OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
>  		   N_("deepen history of shallow repository based on time")),
>  	OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
> -			N_("deepen history of shallow clone by excluding rev")),
> +			N_("deepen history of shallow clone, excluding rev")),
>  	OPT_INTEGER(0, "deepen", &deepen_relative,
>  		    N_("deepen history of shallow clone")),
>  	{ OPTION_SET_INT, 0, "unshallow", &unshallow, NULL,
Previous: Alex HenrieNext: Duy Nguyen
Message 2 of 5 in “clone,fetch: explain the shallow-clone option a little more clearly”
  1. clone,fetch: explain the shallow-clone option a little more clearlyAlex Henrie, Dec 4, 2016
  2. Junio C HamanoDec 5, 2016
  3. Duy NguyenDec 6, 2016
  4. Junio C HamanoDec 6, 2016
  5. Duy NguyenDec 7, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.