From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Michal Pomorski <misieck@gmail.com>, git@vger.kernel.org
Subject: Re: git clone --depth: shallow clone problems
Date: Tue, 26 May 2015 07:54:12 -0700 [thread overview]
Message-ID: <xmqqmw0rl78r.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150526124702.GA12101@lanh> (Duy Nguyen's message of "Tue, 26 May 2015 19:47:02 +0700")
Duy Nguyen <pclouds@gmail.com> writes:
> --unshallow::
> - If the source repository is complete, convert a shallow
> - repository to a complete one, removing all the limitations
> + If the source repository is complete, convert all shallow
> + refs to complete ones, removing all the limitations
Define "shallow ref", or better yet explain without introducing such
a new term (I do not think shallow-ness is a property of a ref, by
the way---I think you meant all refs that can reach the points the
history is cauterised by .git/shallow, but we shouldn't assume that
the target audience of this paragraph to know Git as well as I do).
> imposed by shallow repositories.
> +
> If the source repository is shallow, fetch as much as possible so that
> -the current repository has the same history as the source repository.
> +the all existing refs of current repository have the same history as in
> +the source repository.
Makes sense, modulo "so that the all existing refs" sounds strange
to my ears ("all the existing refs" perhaps).
> ++
> +Note that if the repository is created with --single-branch, which is
> +default for a shallow clone, only one ref is completed. `--unshallow`
> +does not fetch all remaining refs from source repository.
I do not think this "Note" is being as helpful as it could be.
- If the repository was created with --single-branch but if the
user later fetched and started tracking other branches, the
statement "only one ref is completed" is untrue; the true version
is "only the existing refs are completed", which leads to a more
important point. It says the same thing as "all existing refs"
above and does not add any useful information.
- The last sentence is less than useful but merely frustrating---it
says what you cannot do with this option, strongly hints that the
writer of the sentence knows what the reader wants to achieve,
but without saying what other way the reader go to achieve it.
Perhaps replace that Note paragraph with something along this line?
+
By fetching and tracking refs that you haven't been tracking,
you can add these new refs to "all refs" to be unshallowed.
>> 2) git fetch --unshallow should convert the clone into an actual
>> equivalent of a normal, not shallow clone.
>
> I was thinking of some way to undo --single-branch too. I don't think
> it should be the job of --unshallow, maybe a new option, but I can't
> think of a name better than --really-unshallow :P
Isn't that just the matter of updating remote.origin.fetch? I do
not think it belongs to "clone" (or "fetch"). Perhaps it belongs to
"remote", where it already shows with "git remote -v" what is
fetched and pushed.
> --depth <depth>::
> Create a 'shallow' clone with a history truncated to the
> - specified number of revisions.
> + specified number of revisions. --single-branch is
> + automatically specified unless the user overrides it with
> + --no-single-branch
Yeah, something like that would be a definite improvement.
By the way, while composing this message, I scratched my head after
typing
$ git clone --shallow=4 --no-local ./git.git ./playpen
Is it just me or do we want to add such a synonym?
Thanks.
next prev parent reply other threads:[~2015-05-26 14:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 14:53 git clone --depth: shallow clone problems Michal Pomorski
2015-05-26 12:47 ` Duy Nguyen
2015-05-26 14:54 ` Junio C Hamano [this message]
2015-05-29 11:04 ` Duy Nguyen
2015-05-29 15:52 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmw0rl78r.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=misieck@gmail.com \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.