Skip to content

Instantly share code, notes, and snippets.

@nealrs
Last active November 4, 2015 15:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nealrs/7e03deca545fdb2303b7 to your computer and use it in GitHub Desktop.
Save nealrs/7e03deca545fdb2303b7 to your computer and use it in GitHub Desktop.
SpotGIT :: Add Spotify status to commit messages [OSX]
#!/bin/zsh
#
# Thanks to this SO thread: http://stackoverflow.com/questions/5894946/how-to-add-gits-branch-name-to-the-commit-message
# and this awesome shell/applescript from @cpu: https://github.com/binaryparadox/SpotifyInfo/blob/master/spotifyInfo
# I was able to write a git hook that appends current Spotify status to your commit messages (in OSX). It's a fun hack.
# Download @cpu's script and note the path, plug it in below and add this hook to your main .git/hooks directory, or do it on a project by project basis
echo $(cat "$1")' | spotify: '$(~/path/to/spotifyInfo all) > "$1"
@nealrs
Copy link
Author

nealrs commented Apr 9, 2014

This script could be improved with better handling for multiline messages.

Oh - and here's a preview of the console output:
console output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment