martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
8.32k stars 284 forks source link

cli: implement `workspace add --sparse-patterns` #4408

Closed thoughtpolice closed 3 weeks ago

thoughtpolice commented 3 weeks ago

This flag implements three modes:

This is useful for various tooling like tools that want to run a parallel process that queries the build system (without running into locks/blocking.)

I think continuing to copy sparse patterns makes sense as the default behavior.

Checklist

If applicable:

thoughtpolice commented 3 weeks ago

I quite like the new --sparse-patterns solution, though we could keep going further. Why can't I specify patterns at add time, after all? And if I can do that with workspaces, why not clone? But, let's go one step at a time...

martinvonz commented 3 weeks ago

I quite like the new --sparse-patterns solution, though we could keep going further. Why can't I specify patterns at add time, after all? And if I can do that with workspaces, why not clone? But, let's go one step at a time...

I think the most important feature to have is a way of not including more files than necessary to start with because that can't be worked around. That's important if your working copy is huge, and especially if your files are fetched from a remote. So I think the most important feature is the new --sparse-patterns=empty version. Well, except that we already had that functionality with -r 'root()'. Still, --sparse-patterns=empty seems like a much more natural solution to look for.

martinvonz commented 3 weeks ago

Sorry, my mouse got stuck causing me to click "Close with comment" by mistake

thoughtpolice commented 3 weeks ago

@martinvonz Good input, I changed the name from none to full, which makes much more sense versus empty. PTAL