Skip to content

Instantly share code, notes, and snippets.

@nealrs

nealrs/commit-msg Secret

Last active Nov 4, 2015
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

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