Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with another person? #7

Open
aawiseman opened this issue Dec 23, 2021 · 5 comments
Open

Using with another person? #7

aawiseman opened this issue Dec 23, 2021 · 5 comments

Comments

@aawiseman
Copy link

aawiseman commented Dec 23, 2021

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

@doekman
Copy link
Owner

doekman commented Dec 23, 2021

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.

@aawiseman
Copy link
Author

@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?

@doekman
Copy link
Owner

doekman commented Dec 24, 2021

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.

@aawiseman
Copy link
Author

Thank you, I will try that! Happy holidays to you too!

@doekman
Copy link
Owner

doekman commented Dec 28, 2021

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

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

No branches or pull requests

2 participants