git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@jeffhostetler.com, git@vger.kernel.org, peff@peff.net,
	"Jeff Hostetler" <jeffhost@microsoft.com>,
	"René Scharfe" <l.s.r@web.de>,
	"Brandon Williams" <bwilliamseng@gmail.com>
Subject: Re: [PATCH v12 5/5] read-cache: speed up has_dir_name (part 2)
Date: Sun, 05 Jul 2020 23:39:55 -0700	[thread overview]
Message-ID: <xmqqr1tp9mf8.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200704172708.GC11341@szeder.dev> ("SZEDER Gábor"'s message of "Sat, 4 Jul 2020 19:27:08 +0200")

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.

  parent reply	other threads:[~2020-07-06  6:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 17:06 [PATCH v12 0/5] read-cache: speed up add_index_entry git
2017-04-19 17:06 ` [PATCH v12 1/5] read-cache: add strcmp_offset function git
2017-04-19 17:06 ` [PATCH v12 2/5] p0006-read-tree-checkout: perf test to time read-tree git
2017-04-19 17:06 ` [PATCH v12 3/5] read-cache: speed up add_index_entry during checkout git
2017-04-19 17:06 ` [PATCH v12 4/5] read-cache: speed up has_dir_name (part 1) git
2017-04-19 17:06 ` [PATCH v12 5/5] read-cache: speed up has_dir_name (part 2) git
2020-07-04 17:27   ` SZEDER Gábor
2020-07-05  5:27     ` René Scharfe
2020-07-06  6:39     ` Junio C Hamano [this message]
2020-07-08 13:49       ` Jeff Hostetler
2020-07-16 17:11         ` René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqr1tp9mf8.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=bwilliamseng@gmail.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).