git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] clone,fetch: explain the shallow-clone option a little more clearly
@ 2016-12-04 22:03 Alex Henrie
  2016-12-05 18:28 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Henrie @ 2016-12-04 22:03 UTC (permalink / raw)
  To: pclouds, gitster, git; +Cc: Alex Henrie

"deepen by excluding" does not make sense because excluding a revision
does not deepen a repository; it makes the repository more shallow.

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,
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly
  2016-12-04 22:03 [PATCH] clone,fetch: explain the shallow-clone option a little more clearly Alex Henrie
@ 2016-12-05 18:28 ` Junio C Hamano
  2016-12-06  9:34   ` Duy Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2016-12-05 18:28 UTC (permalink / raw)
  To: Alex Henrie; +Cc: pclouds, git

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.

>
> 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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly
  2016-12-05 18:28 ` Junio C Hamano
@ 2016-12-06  9:34   ` Duy Nguyen
  2016-12-06 18:29     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Duy Nguyen @ 2016-12-06  9:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alex Henrie, Git Mailing List

On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I however offhand do not think the feature can be used to make the
> repository shallower

I'm pretty sure it can, though it's a waste because you should be able
to shorten your history without talking to a remote server. But that
no-remote shortening is not implemented yet. And you probably want an
option to check with remote anyway to make sure the part you cut out
is available there, no history will be lost.
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly
  2016-12-06  9:34   ` Duy Nguyen
@ 2016-12-06 18:29     ` Junio C Hamano
  2016-12-07 14:07       ` Duy Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2016-12-06 18:29 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Alex Henrie, Git Mailing List

Duy Nguyen <pclouds@gmail.com> writes:

> On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I however offhand do not think the feature can be used to make the
>> repository shallower
>
> I'm pretty sure it can,...

I wrote my message after a short local testing, but it is very
possible I botched it and reached a wrong conclusion above.

If we can use the command to make it shallower, then the phrase
"deepen" would probably be what we need to be fixing in this patch:

>  	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")),

Perhaps a shorter version of:

    Adjust the depth of shallow clone so that commits that are
    decendants of the named rev are made available, while commits
    that are ancestors of the named rev are made beyond reach.

or something like that.  Here is my (somewhat botched) attempt:

    Adjust shallow clone's history to be cut at the rev



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly
  2016-12-06 18:29     ` Junio C Hamano
@ 2016-12-07 14:07       ` Duy Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Duy Nguyen @ 2016-12-07 14:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alex Henrie, Git Mailing List

On Wed, Dec 7, 2016 at 1:29 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> I however offhand do not think the feature can be used to make the
>>> repository shallower
>>
>> I'm pretty sure it can,...
>
> I wrote my message after a short local testing, but it is very
> possible I botched it and reached a wrong conclusion above.
>
> If we can use the command to make it shallower, then the phrase
> "deepen" would probably be what we need to be fixing in this patch:
>
>>       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")),
>
> Perhaps a shorter version of:
>
>     Adjust the depth of shallow clone so that commits that are
>     decendants of the named rev are made available, while commits
>     that are ancestors of the named rev are made beyond reach.
>
> or something like that.  Here is my (somewhat botched) attempt:
>
>     Adjust shallow clone's history to be cut at the rev

OK mine is "exclude the given tag from local history".

BTW the clone's string could be rephrased better because we know
there's no local history to begin with, if we stick to any verbs that
involves deepening or shortening.
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-07 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 22:03 [PATCH] clone,fetch: explain the shallow-clone option a little more clearly Alex Henrie
2016-12-05 18:28 ` Junio C Hamano
2016-12-06  9:34   ` Duy Nguyen
2016-12-06 18:29     ` Junio C Hamano
2016-12-07 14:07       ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).