Created
November 27, 2015 13:04
-
-
Save Glutexo/75482ee215ed19e95f4f to your computer and use it in GitHub Desktop.
Outputs git-big-picture to the “big-picture.svg” file every time something in a git repository changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Uses ruby to encode JSON, watchman to watch for changes, git-big-picture to output the image. | |
# Can be improved by watching only file creation/deletion, since content changes are irrelevant. | |
CURRENT_PATH=`pwd` | |
JSON=`HEADS_PATH="$CURRENT_PATH/.git/logs/refs/heads" ruby -e "require 'json'; puts JSON.dump ENV['HEADS_PATH']"` | |
watchman -j <<-EOT | |
["watch", $JSON] | |
EOT | |
watchman -j <<-EOT | |
["trigger", $JSON, { | |
"name": "big-picture", | |
"append_files": false, | |
"chdir": "../../../../", | |
"command": ["git", "big-picture", "-o", "big-picture.svg"] | |
}] | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment