git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: JunkYardMail1 <JunkYardMail1@Frontier.com>,
	git@vger.kernel.org, Elijah Newren <newren@gmail.com>
Subject: Re: Sparse Checkout Trouble (2.5.0)
Date: Fri, 24 Jan 2020 10:40:57 -0500	[thread overview]
Message-ID: <405d83bd-cd50-49c5-a068-6d3ce102f669@gmail.com> (raw)
In-Reply-To: <d4056731-c13b-c89d-dfd2-e6235e29fed6@gmail.com>

On 1/21/2020 8:19 PM, Derrick Stolee wrote:
> On 1/21/2020 7:42 PM, JunkYardMail1 wrote:
>> Reverting back to the previous version (2.24.1) allowed to un-stage the
>> files and reset the changes.
> 
> This is definitely pointing to a regression, and the feature did get a
> bit of an overhaul. The goal was to not change how existing users
> interacted with it, though, so this is a bit alarming.
> 
> I did find a behavior change related to these paths in Git for Windows
> 2.25.0 versus 2.24.1:
> 
>   $ git clone https://github.com/derrickstolee/git-sparse-checkout-test
>   Cloning into 'git-sparse-checkout-test'...
>   remote: Enumerating objects: 6, done.
>   remote: Counting objects: 100% (6/6), done.
>   remote: Compressing objects: 100% (4/4), done.
>   remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
>   Receiving objects: 100% (6/6), done.
>   error: invalid path 'directory-1/prn/a'
>   fatal: unable to checkout working tree
>   warning: Clone succeeded, but checkout failed.
>   You can inspect what was checked out with 'git status'
>   and retry with 'git restore --source=HEAD :/'
>   
> The checkout here is _expected_ to fail, due to the protected
> filenames. What is troublesome is the following sparse-checkout
> commands fail, and the read-tree command fails in a way that
> 2.24.1 does not:
>  
>   $ git sparse-checkout init
>   error: invalid path 'directory-1/prn/a'
>   error: invalid path 'directory-1/prn/a'
>   
>   $ git sparse-checkout set "/*" "\!/*/"
>   error: invalid path 'directory-1/prn/a'
>   error: invalid path 'directory-1/prn/a'
>   
>   $ git read-tree -mu HEAD
>   error: invalid path 'directory-1/prn/a'
> 
> The double error messages are due to the "try with an in-memory
> pattern set, then roll back if there is a failure." The patterns
> we are trying to create do not include the directory that is failing.
> 
> I'll keep looking into this.

I am still struggling to find out exactly what goes wrong here.

I'm CC'ing Elijah because he also made changes to dir.c, and
perhaps he has some idea of what's going on.

Using GIT_TRACE2_PERF=1, I can see that the error appears during
the traverse_trees() which is after the sparse-checkout patterns
have applied the skip-worktree bit. 

Thanks,
-Stolee

  parent reply	other threads:[~2020-01-24 15:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  0:42 Sparse Checkout Trouble (2.5.0) JunkYardMail1
2020-01-22  1:19 ` Derrick Stolee
2020-01-22  2:06   ` JunkYardMail1
2020-01-24 15:40   ` Derrick Stolee [this message]
2020-01-25 20:59     ` Elijah Newren
2020-01-26 14:09       ` Derrick Stolee
2020-01-28  5:21         ` Elijah Newren
2020-01-28 20:47           ` Derrick Stolee
2020-01-29 15:30             ` Johannes Schindelin
2020-01-29 15:40               ` Derrick Stolee
2020-01-29 16:31                 ` Derrick Stolee

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=405d83bd-cd50-49c5-a068-6d3ce102f669@gmail.com \
    --to=stolee@gmail.com \
    --cc=JunkYardMail1@Frontier.com \
    --cc=git@vger.kernel.org \
    --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).