git-slack-hook
git-slack-hook copied to clipboard
Fix garbled message for multiple commits. Make each one an attachment.
Fixes issue 24.
Unfortunately this doesn't work for commits that contain multiple lines in the message.
{ "fallback" : "", "color" : "good", "fields" : [{"title":"leonard","value":"multiline","short":false}]},
- test
- message
- here
- test
{ "fallback" : "", "color" : "good", "fields" : [{"title":"leonard","value":"This is a test","short":false}]},
- that has multiple
- lines so we can
- see what the issue
- is with the
- post receive hook
{ "fallback" : "", "color" : "good", "fields" : [{"title":"leonard","value":"another test...","short":false}]},
{ "fallback" : "", "color" : "good", "fields" : [{"title":"leonard","value":"more testing","short":false}]},
~~I'm not experienced enough with multiline sed or I'd offer a suggestion. Or maybe Perl or something would be a better choice?~~
~~Thanks for the fix by the way, for single-line commits it's wonderful. Hopefully this will get integrated! :)~~
I've aded a new pull request (#27) which fixes both the multiline commit message and multiple commit message problems.