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

Re: git clone --depth: shallow clone problems

From
Junio C Hamano <gitster@pobox.com>
Date
May 29, 2015, 15:52 UTC
Message-ID
<xmqqiobbe5zu.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8AO7UNF-SnuqohOPDy2dOvfg=bA+b0rdVihabxBLAz19Q@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 20 quoted lines
> On Tue, May 26, 2015 at 9:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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).
>
> OK maybe
>
> Make sure all existing refs have the same history as the ones from the
> source repository. If the source repository is complete, this removes
> all limitations imposed by shallow repositories.

OK, I can understand that description a lot easier than the original one.

Show 27 quoted lines
>>> ++
>>> +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.
>
> It was meant to emphasize --unshallow would not create a true clone,
> if people miss the keywords "all existing" refs.. Maybe..

I know; it is not helpful to describe what it does *NOT* do, without saying what the reader is likely trying to find out.

> You may need to fetch and track other refs from the source repository
> if you want to make full clone.
That is much better.
Previous: Duy Nguyen
Message 5 of 5 in “git clone --depth: shallow clone problems”
  1. Michal PomorskiApr 23, 2015
  2. Duy NguyenMay 26, 2015
  3. Junio C HamanoMay 26, 2015
  4. Duy NguyenMay 29, 2015
  5. Junio C HamanoMay 29, 2015

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.