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

Re: [PATCH 1/5] upload-pack: look up "want" lines via commit-graph

From
Derrick Stolee <derrickstolee@github.com>
Date
Mar 2, 2022, 18:53 UTC
Message-ID
<9a3b8e63-6b61-5e7a-ec71-3777f5bc45f7@github.com>
In-Reply-To
<Yh3mR3/h/+nFyF6V@ncase>
On 3/1/2022 4:24 AM, Patrick Steinhardt wrote:
> On Tue, Mar 01, 2022 at 09:43:19AM +0100, Patrick Steinhardt wrote:
>> On Wed, Feb 23, 2022 at 09:13:53AM -0500, Derrick Stolee wrote:
>>> On 2/23/2022 7:35 AM, Patrick Steinhardt wrote:
Show 24 quoted lines
>>>> -		o = parse_object(the_repository, &oid);
>>>> +		commit = lookup_commit_in_graph(the_repository, &oid);
>>>> +		if (commit)
>>>> +			o = &commit->object;
>>>> +		else
>>>> +			o = parse_object(the_repository, &oid);
>>>> +
>>>
>>> This is a neat trick. I see that we've also done this trick in
>>> revision.c:get_reference(). Perhaps it is worth creating a helper,
>>> maybe named parse_probably_commit()?
>>
>> That might be a good idea, thanks. I'll have a look at what the end
>> result would look like.
>>
>> Patrick
> 
> I had a look at existing callsites which use `lookup_commit_in_graph()`,
> but I found that it wasn't easily possible to convert them all to use a
> new helper like you propose. Most of them have some custom logic like
> skipping `parse_object()` if it's part of a promisor pack, so I really
> only found two locations where such a new helper could be used without
> also adding and supporting flags. I don't really think that's worth it
> for now.
Thanks for taking the time to look into it.
-Stolee
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 9 of 20 in “fetch: more optimizations for mirror fetches”
  1. 0/5 fetch: more optimizations for mirror fetchesPatrick Steinhardt, Feb 23, 2022
  2. 2/5 fetch: avoid lookup of commits when not appending to FETCH_HEADPatrick Steinhardt, Feb 23, 2022
  3. Derrick StoleeFeb 23, 2022
  4. Patrick SteinhardtMar 1, 2022
  5. 1/5 upload-pack: look up "want" lines via commit-graphPatrick Steinhardt, Feb 23, 2022
  6. Derrick StoleeFeb 23, 2022
  7. Patrick SteinhardtMar 1, 2022
  8. Patrick SteinhardtMar 1, 2022
  9. Derrick StoleeMar 2, 2022
  10. 3/5 refs: add ability for backends to special-case reading of symbolic refsPatrick Steinhardt, Feb 23, 2022
  11. 4/5 remote: read symbolic refs via `refs_read_symbolic_ref()`Patrick Steinhardt, Feb 23, 2022
  12. 5/5 refs/files-backend: optimize reading of symbolic refsPatrick Steinhardt, Feb 23, 2022
  13. 0/5 fetch: more optimizations for mirror fetchesPatrick Steinhardt, Mar 1, 2022
  14. 1/5 upload-pack: look up "want" lines via commit-graphPatrick Steinhardt, Mar 1, 2022
  15. 2/5 fetch: avoid lookup of commits when not appending to FETCH_HEADPatrick Steinhardt, Mar 1, 2022
  16. 3/5 refs: add ability for backends to special-case reading of symbolic refsPatrick Steinhardt, Mar 1, 2022
  17. 4/5 remote: read symbolic refs via `refs_read_symbolic_ref()`Patrick Steinhardt, Mar 1, 2022
  18. 5/5 refs/files-backend: optimize reading of symbolic refsPatrick Steinhardt, Mar 1, 2022
  19. Junio C HamanoMar 1, 2022
  20. Derrick StoleeMar 2, 2022

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.