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
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2020, 06:39 UTC
Message-ID
<xmqqr1tp9mf8.fsf@gitster.c.googlers.com>
In-Reply-To
<20200704172708.GC11341@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 9 quoted lines
>> +				 * 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.
Previous: René ScharfeNext: Jeff Hostetler
Message 8 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.