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

Re: [PATCH v12 5/5] read-cache: speed up has_dir_name (part 2)

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Jul 8, 2020, 13:49 UTC
Message-ID
<be8dec3e-087e-b973-280d-3d0d2e481de6@jeffhostetler.com>
In-Reply-To
<xmqqr1tp9mf8.fsf@gitster.c.googlers.com>
On 7/6/20 2:39 AM, Junio C Hamano wrote:
Show 14 quoted lines
> SZEDER Gábor <szeder.dev@gmail.com> writes:
> 
>>> +				 * last: xxx/yy-file (because '-' sorts before '/')
>>> +				 * this: xxx/yy/abc
>>
>> This is problematic, because the index can already contain 'xxx/yy' as
>> a file, when adding 'xxx/yy/abc', but since 'xxx/yy' as a file sorts
>> before 'xxx/yy-file', the short-circuiting here doesn't see it and
>> thus leaves the d-f collision undetected.  Consequently, even Git
>> porcelain commands can create tree objects with duplicate entries, as
>> demonstrated in the tests below.
> 
> Yeah, the "optimization" is quite bogus.  Thanks for catching it.
> 

yes, thanks! Jeff

Previous: Junio C HamanoNext: René Scharfe
Message 9 of 11 in “read-cache: speed up add_index_entry”
  1. 0/5 read-cache: speed up add_index_entrygit@jeffhostetler.com, Apr 19, 2017
  2. 2/5 p0006-read-tree-checkout: perf test to time read-treegit@jeffhostetler.com, Apr 19, 2017
  3. 1/5 read-cache: add strcmp_offset functiongit@jeffhostetler.com, Apr 19, 2017
  4. 3/5 read-cache: speed up add_index_entry during checkoutgit@jeffhostetler.com, Apr 19, 2017
  5. 5/5 read-cache: speed up has_dir_name (part 2)git@jeffhostetler.com, Apr 19, 2017
  6. SZEDER GáborJul 4, 2020
  7. René ScharfeJul 5, 2020
  8. Junio C HamanoJul 6, 2020
  9. Jeff HostetlerJul 8, 2020
  10. René ScharfeJul 16, 2020
  11. 4/5 read-cache: speed up has_dir_name (part 1)git@jeffhostetler.com, Apr 19, 2017

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.