git-slack-hook icon indicating copy to clipboard operation
git-slack-hook copied to clipboard

Fix garbled message for multiple commits. Make each one an attachment.

Open vonbetz opened this issue 9 years ago • 1 comments

Fixes issue 24.

vonbetz avatar Mar 25 '16 23:03 vonbetz

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.

legecha avatar Mar 29 '16 10:03 legecha