All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Charles Bailey <charles@hashpling.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] grep: fix grepping for "intent to add" files
Date: Wed, 22 Jun 2016 11:00:58 -0700	[thread overview]
Message-ID: <xmqqlh1xm7c5.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CACsJy8C9Dh_Owr3UFJnCtvXserG4V-e1ws8ZY52ME1yr+fefOw@mail.gmail.com> (Duy Nguyen's message of "Wed, 22 Jun 2016 18:11:35 +0200")

Duy Nguyen <pclouds@gmail.com> writes:

>> So I wonder if a better change would be more like
>>
>>         for (...) {
>>                 if (!S_ISREG(ce->ce_mode))
>>                         continue; /* not a regular file */
>>                 if (!ce_path_match(ce, pathspec, NULL)
>>                         continue; /* uninteresting */
>> +               if (cached && ce_intent_to_add(ce))
>> +                       continue; /* path not yet in the index */
>>
>>                 if (cached || ...)
>>                         UNCHANGED FROM THE ORIGINAL
>>
>> perhaps?
>
> I did wonder a bit about these cases. But, can i-t-a really be
> combined with CE_VALID or CE_SKIP_WORKTREE? CE_SKIP_... is
> automatically set and should not cover i-t-a entries imo (I didn't
> check the implementation). CE_VALID is about real entries, yes you
> could do "git update-index --assume-unchanged <ita-path>" but it does
> not feel right to me.

Yeah but we know people are stupid^W^Wdo unexpected things ;-)

> If cached is false and ce_ita() is true and either CE_VALID or
> CE_SKIP_WORKTREE is set, we would continue to grep an _empty_ SHA-1.
> But I think we should grep_file() instead, at least for CE_VALID.

Yes, that is the breakage I noticed in the patch under discussion
and that I wanted to fix in the "I wonder if a better change would
be..." version.

  reply	other threads:[~2016-06-22 18:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 21:14 [PATCH v2 1/2] Fix duplicated test name Charles Bailey
2016-06-21 21:14 ` [PATCH v2 2/2] grep: fix grepping for "intent to add" files Charles Bailey
2016-06-21 22:49   ` Junio C Hamano
2016-06-22 16:11     ` Duy Nguyen
2016-06-22 18:00       ` Junio C Hamano [this message]
2016-06-22 18:32         ` Duy Nguyen
2016-06-22 19:17           ` Junio C Hamano
2016-06-22  1:13   ` Eric Sunshine
2016-06-22 16:01     ` Duy Nguyen

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=xmqqlh1xm7c5.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=charles@hashpling.org \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.