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

Re: Shallow clone

From
Junio C Hamano <junkio@cox.net>
Date
Nov 9, 2006, 04:04 UTC
Message-ID
<7vac31p8om.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45521AE9.7050902@gmail.com>
"Aneesh Kumar K.V" <aneesh.kumar@gmail.com> writes:
Show 20 quoted lines
>> I am trying to test this feature. Is there a documentation
>> .git/shallow some where. Atleast what those entries
>> mean ? I know in the mail johannes mentioned only core git will
>> touch this file. But it should be ok to be descriptive like other
>> files. (FETCH_HEAD)
>
> diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt
> index 275d18b..03a6f77 100644
> --- a/Documentation/repository-layout.txt
> +++ b/Documentation/repository-layout.txt
> @@ -141,3 +141,9 @@ logs/refs/heads/`name`::
>  
>  logs/refs/tags/`name`::
>  	Records all changes made to the tag named `name`.
> +
> +shallow::
> +	Records the sha1 of the commits which is marked to have no
> +	parents to represent a shallow repository.The commit object
> +	will have the parent information present. It carry one
> +	record per line.

I would drop the second sentence which is just confusing but otherwise it is correct, I think (I just started trying it out).

But it seems to need some more work. I just tried to clone git.git with --depth=1 and it cauterizes each branch with two commits (I think that is what depth=1 means -- the latest and one behind it), but it pulled almost the whole repository anyway, and it turns out that "git log v1.4.3-rc1" gives me the full history leading to it.

Subsequent "git fetch --depth 99999" makes the branches connected to the root commit, and I am reasonably sure we do not have that many commits, but .git/shallow did not become empty.

I haven't followed the code closely enough to tell if these are just minor details needing more polish, or something more fundamental in the design.

Previous: Aneesh Kumar K.VNext: Aneesh Kumar
Message 5 of 20 in “What's in git.git”
  1. Junio C HamanoNov 8, 2006
  2. David LangNov 8, 2006
  3. Shallow clone [Was Re: What's in git.git ]Aneesh Kumar K.V, Nov 8, 2006
  4. Aneesh Kumar K.VNov 8, 2006
  5. Junio C HamanoNov 9, 2006
  6. Aneesh KumarNov 9, 2006
  7. Alexandre JulliardNov 11, 2006
  8. Junio C HamanoNov 12, 2006
  9. Sergey VlasovNov 12, 2006
  10. Junio C HamanoNov 12, 2006
  11. Junio C HamanoNov 13, 2006
  12. Petr BaudisNov 12, 2006
  13. Junio C HamanoNov 12, 2006
  14. Johannes SchindelinNov 12, 2006
  15. Jakub NarebskiNov 8, 2006
  16. Junio C HamanoNov 8, 2006
  17. Jakub NarebskiNov 8, 2006
  18. Junio C HamanoNov 8, 2006
  19. Petr BaudisNov 8, 2006
  20. Junio C HamanoNov 9, 2006

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.