Skip to content

Instantly share code, notes, and snippets.

@bk2204
Created January 13, 2020 15:36
Show Gist options
  • Save bk2204/a8872ac24c627ca98c9dd98119759401 to your computer and use it in GitHub Desktop.
Save bk2204/a8872ac24c627ca98c9dd98119759401 to your computer and use it in GitHub Desktop.
A script to flow a commit message for use in the GitHub UI
#!/bin/sh
REV="${1:-HEAD}"
git show --no-patch --format=tformat:"%b" -1 "$REV" | \
ruby -e 'puts $stdin.read.split("\n\n").map { |c| c.gsub("\n", " ") }.join("\n\n")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment