git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
To: Elijah Newren <newren@gmail.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git <git@vger.kernel.org>, Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] unpack-trees: do not set SKIP_WORKTREE on submodules
Date: Thu, 18 Jun 2020 11:34:11 -0300	[thread overview]
Message-ID: <CAHd-oW7tT7GhHz7mCH9Y66B=kriBKv8ZyrTXT-VTJgcXGa1Jzw@mail.gmail.com> (raw)
In-Reply-To: <CABPp-BHtwifTHXxoxTKvz0mx45e2N-4SBTTfoRePcmMFAn1O2g@mail.gmail.com>

On Wed, Jun 17, 2020 at 9:24 PM Elijah Newren <newren@gmail.com> wrote:
>
> If someone were
> to try do change their sparsity patterns or even just run a "git
> sparse-checkout reapply" when they had the above issues, they'd see
> something like:
>
>     $ git sparse-checkout reapply
>     warning: The following paths are unmerged and were left despite
> sparse patterns:
>             filename_with_conflicts
>
>     After fixing the above paths, you may want to run `git
> sparse-checkout reapply`.
>
> This basically suggests that we consider uncommitted and unmerged
> files to be "unclean" in some way (sparse-checkout wants to set the
> SKIP_WORKTREE bit on all files that do not match the sparsity
> specification, so "clean" means sparse-checkout is able to do so).  So
> I could amend my earlier comparison and say that IF the user has a
> clean directory, then "git grep --recurse-submodules $REVISION
> $PATTERN" should be equivalent to "git checkout $REVISION && git grep
> --recurse-submodules $PATTERN".  I could also say that given the big
> warnings we give users when we can't set the SKIP_WORKTREE bit, that
> we expect it to be a transient state and thus that we expect them to
> more likely than not clear it out by the time they do switch branches.
> That would lead us to the follow-up rule that if the user does not
> have a clean directory then "git grep --recurse-submodules $REVISION
> $PATTERN" should be equivalent to what you would get if the unclean
> entries were ignored (expecting them to be cleaned before the any `git
> checkout` could be run) and you then otherwise ran "git checkout
> $REVISION && git grep --recurse-submodules $PATTERN".

Makes sense, thanks! We haven't mentioned "git grep --cached" yet, but
it would behave in the same way of the worktree grep, in this case.
(I.e. searching the submodules, as their SKIP_WORTREE bit was not
set.) So I guess it should be fine, as well.

> That suggests that grep's implementation we agreed on earlier is still
> correct (when given a $REVISION ignore submodulees that do not match
> the sparsity patterns), but that unpack-trees/sparse-checkout still
> need an update:
>
> When we notice an initialized submodule that does not match the
> sparsity patterns, we should print a warning just like we do for
> unmerged and dirty entries.

Yeah, seems like a good approach. Thanks for the explanations. Some of
the test cases in mt/grep-sparse-checkout will have to be adjusted
with this change. Should I reroll the series based on the patch you
will send or do you prefer to adjust them in your patch (and make it
dependent on mt/grep-sparse-checkout)?

Thanks,
Matheus

  reply	other threads:[~2020-06-18 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  1:21 [PATCH] unpack-trees: do not set SKIP_WORKTREE on submodules Elijah Newren via GitGitGadget
2020-06-17 17:58 ` Matheus Tavares Bernardino
2020-06-18  0:24   ` Elijah Newren
2020-06-18 14:34     ` Matheus Tavares Bernardino [this message]
2020-06-18 19:19       ` Elijah Newren
2020-06-18 20:29         ` Matheus Tavares Bernardino
  -- strict thread matches above, loose matches on Subject: below --
2020-06-18  1:51 How soon
2020-10-06  0:06 Luv MeZza

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='CAHd-oW7tT7GhHz7mCH9Y66B=kriBKv8ZyrTXT-VTJgcXGa1Jzw@mail.gmail.com' \
    --to=matheus.bernardino@usp.br \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@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).