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

Re: [PATCH v4 2/2] shallow: handling fetch relative-deepen

From
Samo Pogačnik <samo_pogacnik@t-2.net>
Date
Feb 15, 2026, 11:19 UTC
Message-ID
<52d93e12de058d3ccaaebcf8c49a48d85e455171.camel@t-2.net>
In-Reply-To
<c55447544d68c3f98532b1d32183465c8f175ff8.camel@t-2.net>
On Sat, 2026-02-14 at 10:40 +0100, Samo Pogačnik wrote:
Show 30 quoted lines
> On Wed, 2026-02-11 at 14:38 +0100, Patrick Steinhardt wrote:
> > On Fri, Jan 16, 2026 at 10:31:01PM +0000, Samo Pogačnik via GitGitGadget
> > wrote:
> > > 	object_array_clear(&reachable_shallows);
> > >  	} else {
> > >  		struct commit_list *result;
> > >  
> > > -		result = get_shallow_commits(&data->want_obj, depth,
> > > +		if (data->deepen_relative)
> > > +			get_shallows_depth(data);
> > 
> > Okay, so here we now essentially call `get_shallow_commits()` twice. The
> > first time we compute `data->deepen_relative`, only to then pass it back
> > to `get_shallow_commits()` a second time. That feels quite strange to
> > me. Can't we have `get_shallow_commits()` handle this for us directly in
> > a single call?
> > 
> > > +		result = get_shallow_commits(&data->want_obj, NULL, NULL,
> > > +					     data->deepen_relative +
> > > depth,
> > >  					     SHALLOW, NOT_SHALLOW);
> > >  		send_shallow(data, result);
> > >  		free_commit_list(result);
> > 
> 
> I have additional dilemma regarding handling this in a single call.
> Wouldn't it be generally good/useful to have a separate function in shallow.c
> just for measuring current absolute depth instead of blending the measurement
> into get_shallow_commits()?
> 

I prepared another version which i am going to post shortly. It does make a single call to 'get_shallow_commits()' in upload_pack.c, however in shallow.c there is again a common internal function, which is called once for measuring current depth and then again to get a list shallow commits. I do not know how to perform current depth measurement and shallows list retrieval with new depth extended by the same measurement simultaneously. However i find it important to keep common algorithm in a single function for easier maintenance. I hope this is ok.

Best regards, Samo
Previous: Samo PogačnikNext: Samo Pogačnik via GitGitGadget
Message 23 of 27 in “shallow: handling fetch relative-deepen”
  1. 0/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Dec 9, 2025
  2. 1/2 shallow: free local object_array allocationsSamo Pogačnik via GitGitGadget, Dec 9, 2025
  3. Patrick SteinhardtJan 6, 2026
  4. Samo PogačnikJan 9, 2026
  5. Patrick SteinhardtJan 9, 2026
  6. 2/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Dec 9, 2025
  7. Patrick SteinhardtJan 6, 2026
  8. Samo PogačnikJan 9, 2026
  9. 0/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 9, 2026
  10. 1/2 shallow: free local object_array allocationsSamo Pogačnik via GitGitGadget, Jan 9, 2026
  11. 2/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 9, 2026
  12. Junio C HamanoJan 10, 2026
  13. 0/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 10, 2026
  14. 1/2 shallow: free local object_array allocationsSamo Pogačnik via GitGitGadget, Jan 10, 2026
  15. 2/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 10, 2026
  16. Kristoffer HaugsbakkJan 15, 2026
  17. 0/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 16, 2026
  18. 1/2 shallow: free local object_array allocationsSamo Pogačnik via GitGitGadget, Jan 16, 2026
  19. 2/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Jan 16, 2026
  20. Patrick SteinhardtFeb 11, 2026
  21. Samo PogačnikFeb 13, 2026
  22. Samo PogačnikFeb 14, 2026
  23. Samo PogačnikFeb 15, 2026
  24. 0/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Feb 15, 2026
  25. 1/2 shallow: free local object_array allocationsSamo Pogačnik via GitGitGadget, Feb 15, 2026
  26. 2/2 shallow: handling fetch relative-deepenSamo Pogačnik via GitGitGadget, Feb 15, 2026
  27. Junio C HamanoFeb 20, 2026

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.