Skip to content

v0.5.0 — Track by pattern, not by memory

Latest

Choose a tag to compare

@Plumvery Plumvery released this 11 Aug 13:23
· 1 commit to main since this release
e239b59

A project can now say once which files belong in external storage. Until this release that answer only existed in whoever remembered to right-click the asset: a new .psd reached git whenever nobody did, and a new team member had no way to find out what the rule even was.

unilfs.track is that rule written down — a committed plain-text file of gitignore-style patterns, edited in any text editor. It is this package's .gitattributes, except nothing generates it; committing it is what turns "big art files live in storage" into the project's rule rather than one machine's habit.

# UniLFS: files matching a line below live in storage instead of git.
*.psd
*.mp4
Assets/Movies/
!Assets/Movies/thumbs/*.png
Line Means
*.psd no slash: matched against the file name, at any depth
Assets/Movies/ trailing slash: everything under that folder
Assets/**/*.wav ** crosses folders, * stays inside one name, ? is one character
!Assets/UI/*.psd ! excludes — and the last matching line wins, so a later line can re-include
# note comments and blank lines are ignored

What reads it

  • Track Matching (Window > UniLFS) sweeps the whole project and tracks every match nothing tracks yet. Press it after writing the file, or after a git pull brings a teammate's new pattern.
  • Auto Track (Edit > Project Settings > UniLFS, on by default) tracks matching files as they are imported or moved, so a new .psd is out of git from the moment it lands.
  • UniLfsCli.Track does the sweep in batch mode: Unity -batchmode -nographics -quit -executeMethod UniLFS.Editor.UniLfsCli.Track, then ...UniLfsCli.Push. CI no longer needs a hand-written -executeMethod shim to track anything.

Project Settings also gained a Tracked patterns section: how many patterns are in effect, which lines UniLFS could not read, and a button that creates the file from a commented template and opens it in your editor.

What did not change

Both routes end in exactly the same Track as the context menu. Files are staged on this machine and hidden from git, and Push is still the only thing that uploads content and writes a manifest entry — the 0.4.0 rule that an entry exists only once storage has the bytes is untouched. Patterns decide which paths are handed to Track, and nothing else.

The guardrails

  • No line can reach a path Track itself would refuse. Matching runs through the same gate first, so * or ** still never touch a .meta file, the UniLFS files themselves, or anything under Library/, Temp/, Logs/, obj/, UserSettings/ and .git/. There is a test that writes exactly those lines and asserts none of it matches.
  • The sweep reads no file content. It prunes the forbidden trees a directory at a time rather than listing every path under the project root, and files already in the manifest or in staging are counted and skipped — passing them to Track would hash every tracked byte to conclude there was nothing to do.
  • A line UniLFS cannot read says so (a .. segment, say) in Project Settings and in the sweep's errors, rather than quietly matching nothing and looking like a working rule.
  • Matching ignores case, matching the filesystems Unity runs on by default.

Upgrading from 0.4.x

Nothing to do, and nothing changes until you opt in: with no unilfs.track in the project, Auto Track does nothing and everything behaves exactly as in 0.4.1. To start, open Edit > Project Settings > UniLFSTracked patterns → Create, write your patterns, press Track Matching, then Push — and commit unilfs.track along with the manifest.

Untracking a file that a pattern still matches will re-track it on the next import; write a ! line for it instead.