Skip to content

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Feb 6, 2025

Fixes #5389

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

…tern

Since we need to scan directory entries recursively in order to detect new
untracked paths, it doesn't make sense to reuse the .gitignore code path.

This change means all untracked file paths are listed in "jj status" even if
the whole directory is untracked. It might be a bit verbose, but should be
okay. Directories like node_modules should be excluded by .gitignore, not by
auto-track pattern.

Fixes jj-vcs#5389
@yuja yuja force-pushed the push-mrxwvurmxktn branch from 5ec637d to 6574f12 Compare February 6, 2025 09:05
@yuja yuja added this pull request to the merge queue Feb 6, 2025
Merged via the queue into jj-vcs:main with commit 6574f12 Feb 6, 2025
37 checks passed
@yuja yuja deleted the push-mrxwvurmxktn branch February 6, 2025 11:28
@jakobhellermann
Copy link
Contributor

I have my home dir as a jj repo with snapshot.auto-track = 'none()', and this change made it so that running jj starts Snapshotting ... for a bunch of folders in my ~ and eventually fails with

Internal error: Failed to snapshot the working copy
Caused by:
1: Failed to read directory /home/jakob/.local/share/containers/storage/volumes/861e72b0da83ff1cee691c51d408c5ca4e2c205a96dc3cc2a530d5a94e43dfb0
2: Permission denied (os error 13)

I suppose it is impossible to support both

  • listing untracked files in untracked folders
  • not walking the entire universe of folders

so you have to decide which one you value more.

I don't thinking having a * in ~/.gitignore is a solution, because you can't override jj file track a gitignore'd file.

@martinvonz
Copy link
Member

Maybe we could report .local/ as untracked without walking it recursively?

@yuja
Copy link
Contributor Author

yuja commented Feb 13, 2025

If there are no tracking entries starting with .local/, yes, we can short-circuit and report all files in .local are untracked. I didn't add such optimization because the purpose of auto-track option is afaik to avoid auto-add of temporary files, etc., not to avoid permission errors or ignore files permanently.

Maybe you can add ~/.local/.gitignore to ignore all files in ~/.local?

because you can't override jj file track a gitignore'd file.

We'll need some command flag to track ignored files.

@martinvonz
Copy link
Member

I didn't add such optimization because the purpose of auto-track option is afaik to avoid auto-add of temporary files, etc., not to avoid permission errors or ignore files permanently.

Right, I should have remembered that. I agree with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jj st does not show untracked files in directories
4 participants