git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git <git@vger.kernel.org>, Elijah Newren <newren@gmail.com>,
	Lars Schneider <larsxschneider@gmail.com>,
	Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] sparse-checkout: stop blocking empty workdirs
Date: Tue, 13 Apr 2021 06:55:31 +0200	[thread overview]
Message-ID: <CAP8UFD13-osOHU7Ug_2iToQZyx2T2neOXzZB=ssmDZLEQoF4eg@mail.gmail.com> (raw)
In-Reply-To: <pull.624.git.1588616864222.gitgitgadget@gmail.com>

On Mon, May 4, 2020 at 8:30 PM Derrick Stolee via GitGitGadget
<gitgitgadget@gmail.com> wrote:

> @@ -302,8 +300,8 @@ test_expect_success 'revert to old sparse-checkout on empty update' '
>                 echo >file &&
>                 git add file &&
>                 git commit -m "test" &&
> -               test_must_fail git sparse-checkout set nothing 2>err &&
> -               test_i18ngrep "Sparse checkout leaves no entry on working directory" err &&
> +               git sparse-checkout set nothing 2>err &&
> +               test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err &&

It looks like this check is obsolete as the "Sparse checkout leaves no
entry on working directory" error has been removed by this patch
below...

>                 test_i18ngrep ! ".git/index.lock" err &&
>                 git sparse-checkout set file
>         )

[...]

> @@ -1706,19 +1704,6 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>
>                         if (apply_sparse_checkout(&o->result, ce, o))
>                                 ret = 1;
> -
> -                       if (!ce_skip_worktree(ce))
> -                               empty_worktree = 0;
> -               }
> -               /*
> -                * Sparse checkout is meant to narrow down checkout area
> -                * but it does not make sense to narrow down to empty working
> -                * tree. This is usually a mistake in sparse checkout rules.
> -                * Do not allow users to do that.
> -                */
> -               if (o->result.cache_nr && empty_worktree) {
> -                       ret = unpack_failed(o, "Sparse checkout leaves no entry on working directory");

...here...

> -                       goto done;
>                 }
>                 if (ret == 1) {
>                         /*

[...]

> @@ -1824,28 +1808,12 @@ enum update_sparsity_result update_sparsity(struct unpack_trees_options *o)
>
>                 if (apply_sparse_checkout(o->src_index, ce, o))
>                         ret = UPDATE_SPARSITY_WARNINGS;
> -
> -               if (!ce_skip_worktree(ce))
> -                       empty_worktree = 0;
> -       }
> -
> -       /*
> -        * Sparse checkout is meant to narrow down checkout area
> -        * but it does not make sense to narrow down to empty working
> -        * tree. This is usually a mistake in sparse checkout rules.
> -        * Do not allow users to do that.
> -        */
> -       if (o->src_index->cache_nr && empty_worktree) {
> -               unpack_failed(o, "Sparse checkout leaves no entry on working directory");

...and here.

> -               ret = UPDATE_SPARSITY_INDEX_UPDATE_FAILURES;
> -               goto done;
>         }

So maybe instead of the 3 lines below:

> +               git sparse-checkout set nothing 2>err &&
> +               test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err &&
>                 test_i18ngrep ! ".git/index.lock" err &&

we should just have:

               git sparse-checkout set nothing &&

?

      parent reply	other threads:[~2021-04-13  4:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 18:27 [PATCH] sparse-checkout: stop blocking empty workdirs Derrick Stolee via GitGitGadget
2020-05-04 18:41 ` Elijah Newren
2020-05-04 19:53   ` Junio C Hamano
2020-05-04 22:00   ` Taylor Blau
2021-04-13  4:55 ` Christian Couder [this message]

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='CAP8UFD13-osOHU7Ug_2iToQZyx2T2neOXzZB=ssmDZLEQoF4eg@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=larsxschneider@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.
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 NNTP newsgroup(s).