Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
3  .gitignore
... ...
@@ -0,0 +1,3 @@
  1
+git-changelog.sublime-project
  2
+git-changelog.sublime-workspace
  3
+Changelog
14  Readme.md
Source Rendered
... ...
@@ -0,0 +1,14 @@
  1
+# git create changelog
  2
+
  3
+Create changelogs based on your commit messages. Will list every commit between consecutive tags
  4
+
  5
+## Usage
  6
+
  7
+Currently there are no parameters which will be expected
  8
+
  9
+    $ ./git-create-changelog.sh
  10
+
  11
+
  12
+## Installation
  13
+
  14
+But the script somewhere on your executable path. It will be callable as `git create-changelog`.
33  git-create-changelog.sh
... ...
@@ -0,0 +1,33 @@
  1
+#!/bin/bash
  2
+# create changelog based on commit messages
  3
+# one section for each tag
  4
+
  5
+# currently all options are hardcoded
  6
+
  7
+if test -d ".git"; then
  8
+	# yes we are in a git repository
  9
+
  10
+	# clear old changelog
  11
+	echo "# Changelog" > Changelog
  12
+	echo "" >> Changelog
  13
+	
  14
+	#find first commit
  15
+	FIRST_COMMIT=$(git log --pretty=format:'%H'|tail -1)
  16
+
  17
+	#substract tags from repository
  18
+	TAGS_STR=$(git tag -l)
  19
+	TAGS=(${TAGS_STR// / })
  20
+	LAST=$FIRST_COMMIT
  21
+
  22
+	for i in "${TAGS[@]}"; do
  23
+		# for each commit
  24
+		echo "" >> Changelog
  25
+		echo "## $i" >> Changelog
  26
+		echo "" >> Changelog
  27
+		git log $LAST...$i --pretty=format:' - %h %s (%an <%ae>)' --reverse | grep -v 'Merge branch' >> Changelog
  28
+		LAST=$i
  29
+	done
  30
+else
  31
+	echo "No git repository present"
  32
+	exit 1
  33
+fi

No commit comments for this range

Something went wrong with that request. Please try again.