Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doekman/osagitfilter
Filter to put OSA languages (AppleScript, JavaScript) into git, as if they where plain text-files
https://github.com/doekman/osagitfilter
applescript git-filter scpt
Last synced: 3 months ago
JSON representation
Filter to put OSA languages (AppleScript, JavaScript) into git, as if they where plain text-files
- Host: GitHub
- URL: https://github.com/doekman/osagitfilter
- Owner: doekman
- License: mit
- Created: 2017-12-29T16:05:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T21:03:19.000Z (about 3 years ago)
- Last Synced: 2024-08-02T16:07:23.067Z (6 months ago)
- Topics: applescript, git-filter, scpt
- Language: Shell
- Homepage:
- Size: 97.7 KB
- Stars: 33
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- open-source-mac-os-apps - osagitfilter - Filter to put OSA languages (AppleScript, JavaScript) into git, as if they where plain text-files. ![shell_icon] ![applescript_icon] (Applications / Development)
- open-source-mac-os-apps - osagitfilter - Filter to put OSA languages (AppleScript, JavaScript) into git, as if they where plain text-files. ![shell_icon] ![applescript_icon] (Applications / Development)
README
osagitfilter
============Filter to put [OSA][] languages into a `git`-repository. So you can put your `.scpt`-file (AppleScript, JavaScript) into your git-repository, and get full textual diff support.
Installation
------------Either clone [this repository](https://github.com/doekman/osagitfilter), or download the [latest release](https://github.com/doekman/osagitfilter/releases/latest) and unzip it to a folder where you want to install it.
Configure the filter by running the following command:
./setup.sh configure
For every reporistory you want to use it, put the line `*.scpt filter=osa` in the [gitattributes][] of your repository. Do this by running the command below in the root of your repository:
echo "*.scpt filter=osa" >> .gitattributes
Extra's
-------If you want to add your own git configuration, use the following configure command:
./setup.sh configure --no-git
To reset the configuration, run this command:
./setup.sh reset
If you have trouble with the script, switch on logging with:
./setup.sh configure --git-log
Logging can be found in `~/Library/Logs/Catsdeep/osagitfilter.log` and can be easy inspected with `Console.app`.
Some git-clients, like GitHub Desktop, can be quite chatty so log files grow quite fast. With the following command you can create a new log file, while preserving the old ones:
./setup.sh rotate
Default, it prevents from accidently committing AppleScript files with Debugging Mode (from [AppleScript Debugger][asdbg]) switched on. Run `osagitfilter --help` to see more options.
I've setup a [demo repository][demo] with different `.scpt`-files.
Problems
--------If you want to (re-)apply osagitfilter to a repository (for example, if you already added your binary `.scpt` file to git, but want to use osagitfilter), execute the following statement:
git add --renormalize .
Credits
-------Based on [this answer by Daniel Trebbien][so-ascr-in-git] on stackoverflow and help from [guys on the Script Debugger Forum][asdbg-forum].
[OSA]: https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/osa.html "Apple's Open Scripting Architecture"
[asdbg]: http://latenightsw.com
[so-ascr-in-git]: https://stackoverflow.com/a/14425009/56
[asdbg-forum]: http://forum.latenightsw.com/t/cross-play-between-script-debugger-and-script-editor/834/5
[gitconfig]: https://git-scm.com/docs/git-config
[gitattributes]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
[demo]: https://github.com/doekman/osagitfilter-demo