fs_watch (beta): Touch+Git


fs_watch

A background helper tox to automatically externalize any/all scripts, execs, shaders, text and table DATs, as well as maintain a project folder that mirrors the structure of the project network. This makes it easier to work in teams and properly track changes to files with Git, rather than lose diffs to the internal binary of Toe files. Working on Windows & OSX.
fs_watch_functionality_small_labels.png

Setup:
To initialize, import tox at the root of the network, so it is a sibling node to your main project node and “local” node. Set configuration to desired behavior.
fs_config_small.png
Run on Save:
Defaults include running Externalize on save. To use this functionality, you need to check Increment filename on save in Preferences > General (Backup optional).

Match DATs by type, or tag
You can default externalize all Text DATs, Table DATs and/or Execute DATs, or none by default and only externalize nodes tagged with “fs_watch”. Similarly, you can ignore a node and its children that would otherwise be externalized with “fs_ignore”. These are the default tags, configurable to your liking.
fs_watch_tags_labels.png

Internalize
Ensures that any matching DAT nodes with referenced files are read and the reference is removed. What good is any functionality if you can’t undo it? :slight_smile:

Clean
This cleans the project folder, and moves anything that isn’t referenced by Touch to the trash folder. fs_watch does not permanently delete anything. Note, this functionality can be revamped, currently it works by moving the project folder to the trash, building a fresh one, and pruning anything that exists in both. The most obvious flaw here is that you might lose files that are referenced that are not DATs. This is a quick & dirty solve for now. Would like to build a means of testing if the files is referenced anywhere in Touch, if so, leave it. Or, clean only works on files known to have been externalized by fs_watch. Thoughts welcome.

Improvements / Bugs:

  • Project Folder - currently needs to be a sibling with the Toe file. Breaks if you enter slashes, or reference a folder not siblings with the Toe.
  • Code clean up - of course. This is a beta release, I want to see how people use it, like it, fits into their existing workflows / want out of it. Please give feedback! All thoughts welcome.
  • Not handling nesting Toe’s / Toxes at the moment. Need to further think about best way. Leaning towards not recursing into them, so they can each have their own fs_watch. Or, better yet, configurable.
  • Any bugs that you find! Please help me squash me them all :slight_smile: Going to make a git repo with the next release

fs_watch.tox (9.97 KB)

Nice work here!

Very nice, gonna give this one a whirl!

thanks @ennui @raganmd! Very curious what you think, and if it vibes with your workflow. For me personally, coming from Js, I can’t imagine life without Git so i immediately wanted a tool like this.

As far as portability or people who prefer things internalized, it would be easy to develop with files externalized, and then when deploying or sharing a project, simply internalize all references. So you get to keep a self contained Toe file AND your Git history :slight_smile: