Development Idea: How about a GIT file save option?

I don’t think it would be THAT difficult to implement, and would be great for automatically versioning patches.

The idea would be to set up a local GIT repository and have an option to save patch files in it. So when you save a patch (as opposed to autosave) it gets added to a git repo. Even if it’s 100 local to your work directory it would allow versioning and to some extent allow showing differences with git diff.

Just an idea. I’m not volunteering to do the coding :wink:

1 Like

Not so sexy, but can’t you already save as into a folder that’s a git repo. Of course you would have to manually commit at the desired intervals, but unless I’m missing something (which is likely) it should work?

You could probably make a little Python or bash utility to watch a folder of patch files and then commit at regular intervals.

But you could also just set up a utility to make backups instead of commiting to a repo (would take more space since it’s not doing any diffs like git does) but would be more user friendly to the git-averse. Something based on this gist: You could hack it to be a little nicer for the VCV Rack use case like giving it a folder instead of a single file to back up and increasing the sleep time. (Probably also making some syntax changes to work with a modern version of Python.)

If I end up hacking on this, I’ll share the results :wink:

1 Like

For a second, I pictured in my mind a module doing this, triggering commits to backup my patch…

1 Like

Yeah I can manually commit patches to a git repo. All I was thinking was that if it was more or less transparently part of the file save/file load process it would be easier.

I might break down and try and actually code this into a fork of VCV Rack. I’m weak on audio DSP but strong on that kind of C++ hacking.

1 Like

I think that making it as module as @mixer suggests would be easier (if it’s possible), and also would allow other users to use this functionality. I’ve been brainstorming something like this for a while, ever since this thread: Renaming Conventions: Version Control System.

Could forget about GIT, and just make a module that would “save as” when triggered with -v1, -v2, etc. intelligently appended to the patch filename. That’s probably too much clutter for many, in which case perhaps the module could create a folder for the patch and keep all the versions in there. In either case, I think it would be less work than including GIT and setting up a repository. Another benefit is that the patch files would still exist normally on the users machine.

1 Like

Yeah that’s what I’m personally thinking the more I ponder the Python script I suggested (i.e. just make it a module instead of an external script). I think this is similar to how DAWs do backups, if I’m not mistaken.

Is there a reason for git over a simpler form of versioning? The saved JSON is a machine-readable file not expected to diff cleanly.

1 Like

Cross reference to feature request, which I have rejected:


Here’s a simple tool that watches a folder any commits any changes. I’m sure there are others… google “git watch folder”.