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

Re: [PATCH 4/3] git-fetch: test avoiding unnecessary copying from alternates

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 8, 2007, 08:34 UTC
Message-ID
<20071108083440.GK14735@spearce.org>
In-Reply-To
<20071108082213.GA17054@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> wrote:
> This test verifies my prior "avoid local fetching from alternate"
> patch is functional and doesn't regress in the future during any
> additional improvements made to git.
...
Show 9 quoted lines
> +test_expect_success 'quickfetch should not copy from alternate' '
> +
> +	(
> +		mkdir quickclone &&
> +		cd quickclone &&
> +		git init-db &&
> +		(cd ../.git/objects && pwd) >.git/objects/info/alternates &&
> +		git remote add origin .. &&
> +		git fetch -k -k

Hmmph. On second thought I think this is a little sketchy for a test. Versions without my quickfetch patch fail this test and versions with it pass. But it depends on the implementation of `-k -k` to always call index-pack over unpack-objects.

I'm using -k -k here to ensure we keep the pack fetched as we're only fetching 6 objects and they are already reachable in the quickclone repository thanks to the alternate ODB. If we use unpack-objects during this fetch we will still pass this test because the objects won't be unpacked if they are already reachable locally.

Of course this test is for a performance optimization. For 6 tiny objects it really doesn't matter if we copy them or not, or if we copy them over a pipe only to discard them because they are already reachable. It does however matter when you are talking about nearly 300MB worth of objects. :-\

-- 
Shawn.
Previous: Shawn O. Pearce
Message 2 of 2 in “git-fetch: test avoiding unnecessary copying from alternates”
  1. 4/3 git-fetch: test avoiding unnecessary copying from alternatesShawn O. Pearce, Nov 8, 2007
  2. Shawn O. PearceNov 8, 2007

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.