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

Sha1 lookup and GIT_USE_LOOKUP

From
MPMarc Pegon <pegon.marc@gmail.com>
Date
Jun 8, 2011, 18:31 UTC
Message-ID
<BANLkTintTECbO5X3VMvzHdGgyKmLKe65YE=0mX6Ahj5wutCJ0Q@mail.gmail.com>

Hi, I noticed in find_pack_entry_one the use of the environment variable GIT_USE_LOOKUP, which does not seem to be used anywhere else in git or even in the tests.

Obviously, it determines whether or not a simple binary search or the sha1_entry_pos method (which is apparently some kind of improved binary search) should be used to retrieve the offset of an object (given its sha1) in a pack. Since this environment variable is not set by default, git will always use a simple binary search, won't it ?

Also, when searching for a sha1 given a sha1 prefix, among packed objects, find_short_packed_object also does a simple binary search. Wouldn't it be simpler to just use the sha1_entry_pos method ?

Thanks

-- Marc Pegon

Next: Junio C Hamano
Message 1 of 4 in “Sha1 lookup and GIT_USE_LOOKUP”
  1. Marc PegonJun 8, 2011
  2. Junio C HamanoJun 8, 2011
  3. Marc PegonJun 9, 2011
  4. Michael SchubertJun 9, 2011

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.