Skip to content

Commit

Permalink
Reformats commit notes based on @drewwells template
Browse files Browse the repository at this point in the history
  • Loading branch information
craveytrain committed Jun 5, 2013
1 parent 3340fd9 commit d2d0b64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/git-commit-notes
@@ -1,14 +1,14 @@
#!/bin/bash

COMMIT_ID=$(git rev-parse ${1:-"HEAD"})
COMMIT_ID=$(git rev-parse --short ${1:-"HEAD"})
COMMIT_MSG="$(git log $COMMIT_ID~1..$COMMIT_ID --pretty=%B)"
ORIGIN="$(git config --get remote.origin.url)"
ORIGIN_PATH="${ORIGIN#*github.com\:}"
ORIGIN_PATH_SANS_EXT="${ORIGIN_PATH%.git}"
COMMIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
COMMIT_URL="https://github.com/$ORIGIN_PATH_SANS_EXT/commit/$COMMIT_ID"

COMMIT_NOTES="$COMMIT_MSG\n\nBranch: $COMMIT_BRANCH\n$COMMIT_URL"
COMMIT_NOTES="$COMMIT_ID $COMMIT_URL\n\n$COMMIT_MSG\n\nBranch: $COMMIT_BRANCH"

echo -e "$COMMIT_NOTES"

Expand Down

0 comments on commit d2d0b64

Please sign in to comment.