From 31bbed4ac8aba3b235e06263ad7489f1508c9686 Mon Sep 17 00:00:00 2001 From: Damian Krzeminski Date: Wed, 16 Jan 2013 20:31:22 -0800 Subject: [PATCH 1/2] Add --no-merges option to changelog --no-merges allows for generating changelog without information about merge commits --- bin/git-changelog | 10 +++++++--- etc/bash_completion.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/git-changelog b/bin/git-changelog index a7def4c..f109dcc 100755 --- a/bin/git-changelog +++ b/bin/git-changelog @@ -3,6 +3,7 @@ FILE="" LIST=false TAG="n.n.n" +GIT_LOG_OPTS="" while [ "$1" != "" ]; do case $1 in @@ -13,6 +14,9 @@ while [ "$1" != "" ]; do TAG=$2 shift ;; + --no-merges ) + GIT_LOG_OPTS='--no-merges' + ;; * ) FILE=$1 ;; @@ -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 @@ -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 diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh index e6dbca7..f5a2d0b 100644 --- a/etc/bash_completion.sh +++ b/etc/bash_completion.sh @@ -5,7 +5,7 @@ _git_bug(){ } _git_changelog(){ - __gitcomp "-l -t --list --tag" + __gitcomp "-l -t --list --tag --no-merges" } _git_contrib(){ From e777095a9f0dc673f5dd55a454555455d10fa1be Mon Sep 17 00:00:00 2001 From: Damian Krzeminski Date: Wed, 16 Jan 2013 20:36:12 -0800 Subject: [PATCH 2/2] Update git-changelog docs for --no-merges option --- man/git-changelog.1 | 14 ++++++++++---- man/git-changelog.html | 12 ++++++++---- man/git-changelog.md | 4 ++++ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/man/git-changelog.1 b/man/git-changelog.1 index 57f760c..f576e40 100644 --- a/man/git-changelog.1 +++ b/man/git-changelog.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 -.\" https://github.com/rtomayko/ronn/tree/0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CHANGELOG" "1" "July 2012" "" "" +.TH "GIT\-CHANGELOG" "1" "December 2013" "" "Git Extras" . .SH "NAME" \fBgit\-changelog\fR \- Generate the changelog report @@ -18,6 +18,12 @@ Populates the file named matching \fIchange|history \-i\fR with the commits sinc .P Show commit logs from the current version\. . +.P +\-\-no\-merges +. +.P +Filters out merge commits (commits with more than 1 parent) from generated changelog\. +. .SH "EXAMPLES" . .IP "\(bu" 4 @@ -71,7 +77,7 @@ Initial commit Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR> . .SH "REPORTING BUGS" -<\fIhttp://github\.com/visionmedia/git\-extras/issues\fR> +<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR> . .SH "SEE ALSO" -<\fIhttp://github\.com/visionmedia/git\-extras\fR> +<\fIhttps://github\.com/visionmedia/git\-extras\fR> diff --git a/man/git-changelog.html b/man/git-changelog.html index bdba0bf..84beae4 100644 --- a/man/git-changelog.html +++ b/man/git-changelog.html @@ -2,7 +2,7 @@ - + git-changelog(1) - Generate the changelog report