Skip to content

Instantly share code, notes, and snippets.

@murat
Last active October 11, 2018 20:54
Show Gist options
  • Save murat/1b04574e4110d5a87f2346c9eda59981 to your computer and use it in GitHub Desktop.
Save murat/1b04574e4110d5a87f2346c9eda59981 to your computer and use it in GitHub Desktop.
A shell script for generate CHANGELOG from git log
#!/bin/bash
if [ "$1" == "" ]; then
INITIAL=`git rev-list HEAD | tail -n 1`
else
INITIAL="$1"
fi
git log "$INITIAL"...HEAD --pretty=format:"- [%h](`git remote -v | grep fetch | head -1 | cut -f 2 | cut -d ' ' -f 1 | sed -e 's/git@/https:\/\//' -e's/\.git$//' | sed -E 's/(\/\/[^:]*):/\1\//'`/commit/%H) %s"
@murat
Copy link
Author

murat commented Oct 11, 2018

Usage

# this will use initial commit if you do not give any arg
$ changelog

# this will use given commit
$ changelog 1582477

😅

@murat
Copy link
Author

murat commented Oct 11, 2018

Installation

Copy and paste this script to /usr/bin/changelog or another location, and then make it executable by sudo chmod u+x /path/of/the/changelog

🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment