git/list[1] front-page[2] threads[3] people[4] search[5] about
 

sparse checkout - weird behavior

From
PHPaul Hammant <paul@hammant.org>
Date
Jan 26, 2017, 02:59 UTC
Message-ID
<CA+298Uh=bfCJq3hmVdGUsinAgKFQd86em_J_8fwB9jQR5PZVgQ@mail.gmail.com>
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 I take out the asterisk on the echo line, only 'docs' is checked out after the read-tree operation. Even if asterisk isn't allowed, I'd not expect it to fail in that way. Sparse checkout documentation is a little . .. . sparse it has to be said (sorry).

As it happens, I have some more complicated cases where sparse-checkout is doing the wrong thing in the working copy - and I'll work towards reproduction of that/those after this. Best to start with a simple reproducible case in case there's a simple fix for more that one similar bug.

Regards,
- Paul
Next: Jeff King
Message 1 of 2 in “sparse checkout - weird behavior”
  1. Paul HammantJan 26, 2017
  2. Jeff KingJan 26, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.