0

In git 26.0.2 I was able to perform these steps:

git worktree add --no-checkout ../test_git26 git26
cd ../test_git26
git sparse-checkout init --con
git sparse-checkout set Q/
ls

This ended nicely with one directory in worktree : enter image description here

Exactly same steps with git 27.0.0, ended with empty worktree.

My question is this: Do these steps make sense and should work with git 28, or I'm doing wrong.

Thanks Boaz

Dennis Kozevnikoff
  • 2,078
  • 3
  • 19
  • 29
Boaz Nahum
  • 1,049
  • 8
  • 9
  • The cone-mode sparse checkout is a work in progress, but it's worth reporting issues like this to the Git mailing list. – torek Aug 03 '20 at 17:19
  • @torek I just can't find how to report issue, I have several issues around sparse-checkout which I would like to report. Can you give a tip ? – Boaz Nahum Aug 06 '20 at 14:24
  • In the latest Git, there is a `git-bugreport` command. I haven't actually *used* it but it has [documentation](https://git-scm.com/docs/git-bugreport)... Not sure if you have to manually email its output but see https://git.wiki.kernel.org/index.php/GitCommunity – torek Aug 06 '20 at 19:22

1 Answers1

1

It seems that in git 28 (didn't check 27) you need to checkout after setting sparse-checkout patterns. It it not clear to me why it is not needed in git 26. So the full code is like this:

git worktree add --no-checkout ../test_git26 git26
cd ../test_git26
git sparse-checkout init --con
git sparse-checkout set Q/
git checkout
ls

The only problem with this solution is that checkout is time consume operation, so, in more complex flows, when you just need to modify sparse-checkout pattern, you don't need if checkout is required or not.

Boaz Nahum
  • 1,049
  • 8
  • 9