Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Caleb Jorden <cjorden@gmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] submodule helper list: Respect correct path prefix
Date: Wed, 24 Feb 2016 13:38:04 -0800	[thread overview]
Message-ID: <xmqqpovlssar.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kbbKnips12CU6KZX39rAZ_O-pYy20nsSGCCf+1w5LzgxA@mail.gmail.com> (Stefan Beller's message of "Wed, 24 Feb 2016 13:32:22 -0800")

Stefan Beller <sbeller@google.com> writes:

> On Wed, Feb 24, 2016 at 1:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Stefan Beller <sbeller@google.com> writes:
>>
>>> This is a regression introduced by 74703a1e4d (submodule: rewrite
>>> `module_list` shell function in C, 2015-09-02).
>>>
>>> Add a test to ensure we list the right submodule when giving a specific
>>> path spec.
>>>
>>> Reported-By: Caleb Jorden <cjorden@gmail.com>
>>> Signed-off-by: Stefan Beller <sbeller@google.com>
>>> ---
>>>
>>>  I developed this on top of current origin/master, though I can backport it
>>>  to 2.7 as well if desired.
>>>
>>>  I do not remember the cause why we started to ignore a common prefix.
>>
>> The code you are removing with this patch is probably an
>> optimization you copied from builtin/ls-files.c.  When the
>> optimization is used, the original also limits the list of paths to
>> those that match the prefix by calling prune_cache(), but perhaps
>> you didn't have a corresponding code in your copy?
>
> I think that is a good explanation. So do we want to add the pruning
> or use this patch to fixup the regression and wait until someone complains
> about the speed penalty due to no optimization?

As I do not know offhand if the optimization, especially the pruning
part, applies to the context of this code the same way ls-files does
things (which treats the index read into core as a throw-away data),
we shouldn't even attempt to salvage the faulty half-optimization
until we understand what it involves to make it work.  So "disable
broken optimization and make simple way work correctly" is the good
first step, especially for a fix that is meant to go to 2.7.x
series.

We must first be sure that removing the faulty half-optimization is
the only thing we need to fix this breakage, though ;-)

Thanks.

  reply	other threads:[~2016-02-24 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 21:15 [PATCH] submodule helper list: Respect correct path prefix Stefan Beller
2016-02-24 21:21 ` Junio C Hamano
2016-02-24 21:32   ` Stefan Beller
2016-02-24 21:38     ` Junio C Hamano [this message]
2016-02-24 22:18 ` Caleb Jorden

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

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

  git send-email \
    --in-reply-to=xmqqpovlssar.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=cjorden@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox