osagitfilter
osagitfilter copied to clipboard
Using with another person?
I've been using osagitfilter for an AppleScript project for a while and it's great. Is it possible to use it with multiple people?
Recently my colleague started contributing to the repo too, and he cloned osagitfilter to his repo and did the install steps. On his machine he can see the diffs properly, but when he pushes back to the main repo only he can see the diffs, I just see "binary file not shown" -- is there something we need to do so I can see his changes as well? I tried adding osagitfilter to the repo on the web but I get an error
ERROR: OSA language 'AppleScript Debugger' is forbidden by osagitfilter error: external filter '/usr/local/bin/osagitfilter clean %f' failed 1 error: external filter '/usr/local/bin/osagitfilter clean %f' failed fatal: osagitfilter-0.7.0/assets/asdbg.scpt: clean filter 'osa' failed
Thanks for your comment. Always glad to help out.
The error your friend is getting is actually by design. Your friend is probably using Script Debugger version 7 or below. When you save an AppleScript while in debugging-mode, the editor actually saves the AppleScript in a different way. The format is AppleScript, but with a debugging-statement between every line. You don't want that in git. That's why it gives an error message. The solution is simple.
Ask your friend to switch off debugging mode (the debugging-button in the toolbar should not have a gray rectangle around it), and save again. The error message will disappear.
You can also start using Script Debugger 8, which always saves in Apple's standard AppleScript format.
So yeah, osagitfilter can be used by multiple people, much the same like git itself.
Let me know if this solved your problem.
@doekman Thanks for the quick response! Both of us are actually using Script Editor v 2.11 (AppleScript v 2.7) rather than Script Debugger, maybe that is the issue?
Nope. Script Editor should be supported as well.
I didn't read your initial comment properly, sorry for that.
Adding osagitfilter itself to the repo doesn't work and also doesn't solve your problem.
I just tested the installation script (setup.sh), and it seems to be broken. I don't have time now to fix the setup-script. However, you can do this manually. Basically, you need to add the following section to .gitconfig
, which is a hidden file located in your home folder:
[filter "osa"]
clean = /usr/local/bin/osagitfilter clean --log %f
smudge = /usr/local/bin/osagitfilter smudge --log %f
required = true
Notice the path to the osagitfilter-binary. In the example, the path /usr/local/bin/osagitfilter
is a symbolic link, pointing to osagitfilter.sh
in my repository. You could also add the path to that file directly in the text above. In that case, make sure the .sh
extension is used.
I probably have time next week for the fix. Happy holidays to you.
Thank you, I will try that! Happy holidays to you too!
I fixed the installation-script and made a new release. Could you try this and let me know?
https://github.com/doekman/osagitfilter/releases/tag/v0.7.1