Skip to content

Commit

Permalink
Add --no-merges option to changelog
Browse files Browse the repository at this point in the history
--no-merges allows for generating changelog without information about
merge commits
  • Loading branch information
pirxpilot committed Dec 1, 2013
1 parent 0faaec7 commit 31bbed4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions bin/git-changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FILE=""
LIST=false
TAG="n.n.n"
GIT_LOG_OPTS=""

while [ "$1" != "" ]; do
case $1 in
Expand All @@ -13,6 +14,9 @@ while [ "$1" != "" ]; do
TAG=$2
shift
;;
--no-merges )
GIT_LOG_OPTS='--no-merges'
;;
* )
FILE=$1
;;
Expand All @@ -26,9 +30,9 @@ HEAD="\n$TAG / $DATE\n==================\n\n"
if $LIST; then
version=$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))
if test -z "$version"; then
git log --pretty="format: * %s"
git log $GIT_LOG_OPTS --pretty="format: * %s"
else
git log --pretty="format: * %s" $version..
git log $GIT_LOG_OPTS --pretty="format: * %s" $version..
fi
exit
fi
Expand All @@ -42,7 +46,7 @@ if test "$CHANGELOG" = ""; then
fi
tmp="/tmp/changelog"
printf "$HEAD" > $tmp
git-changelog --list >> $tmp
git-changelog $GIT_LOG_OPTS --list >> $tmp
printf '\n' >> $tmp
if [ -f $CHANGELOG ]; then cat $CHANGELOG >> $tmp; fi
mv $tmp $CHANGELOG
Expand Down
2 changes: 1 addition & 1 deletion etc/bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _git_bug(){
}

_git_changelog(){
__gitcomp "-l -t --list --tag"
__gitcomp "-l -t --list --tag --no-merges"
}

_git_contrib(){
Expand Down

0 comments on commit 31bbed4

Please sign in to comment.