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

Re: [PATCH 3/5] allow cloning a repository "shallowly"

From
Junio C Hamano <junkio@cox.net>
Date
Nov 14, 2006, 17:46 UTC
Message-ID
<7vpsbpzzse.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0611141145390.13772@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 16 quoted lines
>> I understand "no need making it shallow", but I am not sure if a
>> non-NULL return from lookup_object() tells us that.
>
> You are probably right, how about has_sha1_file()?
>
>> I think register_shallow() can take commits that are already shallow() 
>> so maybe we can remove this "if() continue"?
>
> Yes, it can, but that is not necessarily correct: since .git/shallow is 
> constructed from the registered shallow commits, we would make a commit 
> shallow which is really not shallow.
>
> So, how about
>
>> > +				if (lookup_object(sha1) || has_sha1_file(sha1))
>> > +					continue;

If I understand the code correctly, this loop is reading what the other side thinks your shallows should be (based on your earlier "deepen" request or if this is initial fetch based on your depth). Even if we already have that object, if that object _is_ shallow on our end, don't we need to keep it marked as shallow? Will we get ancestors of this commit from the other end (and "shallow" lines for some of them to properly cauterize the chain)?

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 5 in “allow cloning a repository "shallowly"”
  1. 3/5 allow cloning a repository "shallowly"Johannes Schindelin, Oct 30, 2006
  2. Junio C HamanoNov 14, 2006
  3. Johannes SchindelinNov 14, 2006
  4. Junio C HamanoNov 14, 2006
  5. Johannes SchindelinNov 15, 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.