From: Jeff King <peff@peff.net>
To: Paul Hammant <paul@hammant.org>
Cc: git@vger.kernel.org
Subject: Re: sparse checkout - weird behavior
Date: Wed, 25 Jan 2017 23:57:01 -0500 [thread overview]
Message-ID: <20170126045701.eouw5kzyq5bevc5c@sigill.intra.peff.net> (raw)
In-Reply-To: <CA+298Uh=bfCJq3hmVdGUsinAgKFQd86em_J_8fwB9jQR5PZVgQ@mail.gmail.com>
On Wed, Jan 25, 2017 at 09:59:38PM -0500, Paul Hammant wrote:
> 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
next prev parent reply other threads:[~2017-01-26 4:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 2:59 sparse checkout - weird behavior Paul Hammant
2017-01-26 4:57 ` Jeff King [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-01-26 3:21 Paul Hammant
2017-01-26 4:59 ` Jeff King
2017-01-26 11:20 ` Paul Hammant
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=20170126045701.eouw5kzyq5bevc5c@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=paul@hammant.org \
/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).