Permalink
Browse files

initial import of script

  • Loading branch information...
1 parent 6bdab44 commit 037461891bb60d6d55578fc7b3103f2526d9e08e @TheHippo committed Nov 26, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 git-create-changelog.sh
View
@@ -0,0 +1,24 @@
+#!/bin/bash
+# create changelog based on commit messages
+# one section for each tag
+
+if test -d ".git"; then
+
+ echo "# Changelog" > Changelog
+ echo "" >> Changelog
+ FIRST_COMMIT=$(git log --pretty=format:'%H'|tail -1)
+ #echo $FIRST_COMMIT
+ TAGS_STR=$(git tag -l)
+ TAGS=(${TAGS_STR// / })
+ LAST=$FIRST_COMMIT
+ for i in "${TAGS[@]}"; do
+ echo "" >> Changelog
+ echo "## $i" >> Changelog
+ echo "" >> Changelog
+ git log $LAST...$i --pretty=format:' - %h %s (%an <%ae>)' --reverse | grep -v 'Merge branch' >> Changelog
+ LAST=$i
+ done
+else
+ echo "No git repository present"
+ exit 1
+fi

0 comments on commit 0374618

Please sign in to comment.