Last active
August 29, 2015 14:05
-
-
Save cdcabrera/fa8cde5f6bc6d434766b to your computer and use it in GitHub Desktop.
GitShots, take a snapshot when you commit.
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/bash | |
# | |
# Where I pulled this from: https://gist.github.com/jellea/3438926 | |
# | |
# This script will make a webcam snapshot every commit. The jpg file will have | |
# the commit id as the filename. | |
# | |
# This script requires imagesnap. Install with: 'brew install imagesnap' | |
# | |
# Put this file in the '.git/hooks/' name it 'post-commit' and chmod it by: | |
# 'chmod +x .git/hooks/post-commit’ | |
# | |
# If that doesn't work try the below, otherwise it'll interfere with the GitHub gui sync/push | |
# 'chmod 777 .git/hooks/post-commit' | |
# | |
# | |
# Inspired by Victor Martinez (http://coderwall.com/p/xlatfq?p=1&q=) | |
# Creates the .gitshots directory if it doesn’t exist | |
# The '&' helps prevent lag | |
# | |
# | |
PATH="/usr/local/bin:$PATH" | |
mkdir -p .gitshots | |
COMMITID=$(git rev-parse HEAD) | |
TIMESTAMP=$(date +"%Y%m%d-%H%M%S-") | |
imagesnap -q -w 1 .gitshots/$TIMESTAMP$COMMITID.jpg & |
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/bash | |
# | |
# Where I pulled this from: https://gist.github.com/jellea/3438926 | |
# | |
# This script will make a webcam snapshot every commit. The jpg file will have | |
# the commit id as the filename. | |
# | |
# This script requires imagesnap. Install with: 'brew install imagesnap' | |
# | |
# Put this file in the '.git/hooks/' name it 'pre-commit' and chmod it by: | |
# 'chmod +x .git/hooks/pre-commit’ | |
# | |
# If that doesn't work try the below, otherwise it'll interfere with the GitHub gui sync/push | |
# 'chmod 777 .git/hooks/pre-commit' | |
# | |
# | |
# Inspired by Victor Martinez (http://coderwall.com/p/xlatfq?p=1&q=) | |
# Creates the .gitshots directory if it doesn’t exist | |
# The '&' helps prevent lag | |
# | |
# | |
PATH="/usr/local/bin:$PATH" | |
mkdir -p .gitshots | |
COMMITID=$(git rev-parse HEAD) | |
TIMESTAMP=$(date +"%Y%m%d-%H%M%S-") | |
imagesnap -q -w 1 .gitshots/$TIMESTAMP$COMMITID.jpg & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment