Re: sparse checkout - weird behavior
- From
Jeff King <peff@peff.net>
- Date
- Jan 26, 2017, 04:57 UTC
- Message-ID
- <20170126045701.eouw5kzyq5bevc5c@sigill.intra.peff.net>
- In-Reply-To
- <CA+298Uh=bfCJq3hmVdGUsinAgKFQd86em_J_8fwB9jQR5PZVgQ@mail.gmail.com>
On Wed, Jan 25, 2017 at 09:59:38PM -0500, Paul Hammant wrote:
Show 18 quoted lines
> Here's a simple reproducible bug - something unexpected in sparse-checkout mode: > > $ git clone git@github.com:jekyll/jekyll.git --no-checkout > Cloning into 'jekyll'... > remote: Counting objects: 41331, done. > remote: Compressing objects: 100% (5/5), done. > remote: Total 41331 (delta 0), reused 0 (delta 0), pack-reused 41326 > Receiving objects: 100% (41331/41331), 11.91 MiB | 7.98 MiB/s, done. > Resolving deltas: 100% (26530/26530), done. > $ cd jekyll > $ ls > $ git config core.sparsecheckout true > $ echo 'docs*' > .git/info/sparse-checkout > $ git read-tree -mu HEAD > $ ls > docs rake > > I didn't expect to see 'rake' amongst the results.
If you look inside the rake/ directory, you should see that only "docs.rake" was checked out.
The sparse-checkout file uses the same parser as .git/info/exclude. One important aspect of that file is that entries are _not_ left-anchored unless they start with "/". So you asked Git to include files named "docs*" anywhere in the tree.
You probably wanted just:
echo /docs >.git/info/sparse-checkout
-Peff