Merge pull request #159 from code42day/no-merges-changelog

Add --no-merges option to git-changelog
This commit is contained in:
TJ Holowaychuk 2013-12-01 15:54:50 -08:00
commit e91da7c2b4
5 changed files with 30 additions and 12 deletions

View file

@ -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

View file

@ -5,7 +5,7 @@ _git_bug(){
}
_git_changelog(){
__gitcomp "-l -t --list --tag"
__gitcomp "-l -t --list --tag --no-merges"
}
_git_contrib(){

View file

@ -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>

View file

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (https://github.com/rtomayko/ronn/tree/0.7.3)'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-changelog(1) - Generate the changelog report</title>
<style type='text/css' media='all'>
/* style: man */
@ -65,7 +65,7 @@
<ol class='man-decor man-head man head'>
<li class='tl'>git-changelog(1)</li>
<li class='tc'></li>
<li class='tc'>Git Extras</li>
<li class='tr'>git-changelog(1)</li>
</ol>
@ -88,6 +88,10 @@
<p> Show commit logs from the current version.</p>
<p> --no-merges</p>
<p> Filters out merge commits (commits with more than 1 parent) from generated changelog.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<ul>
@ -116,7 +120,7 @@
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Tj Holowaychuk &lt;<a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#116;&#x6a;&#x40;&#x76;&#105;&#x73;&#x69;&#x6f;&#x6e;&#x2d;&#109;&#x65;&#x64;&#105;&#x61;&#x2e;&#x63;&#x61;" data-bare-link="true">&#x74;&#106;&#64;&#x76;&#x69;&#x73;&#x69;&#x6f;&#x6e;&#x2d;&#109;&#101;&#x64;&#x69;&#x61;&#46;&#99;&#97;</a>&gt;</p>
<p>Written by Tj Holowaychuk &lt;<a href="&#x6d;&#97;&#x69;&#108;&#x74;&#111;&#x3a;&#116;&#x6a;&#64;&#x76;&#x69;&#x73;&#x69;&#111;&#110;&#x2d;&#x6d;&#x65;&#100;&#105;&#x61;&#46;&#x63;&#x61;" data-bare-link="true">&#x74;&#x6a;&#x40;&#x76;&#105;&#x73;&#105;&#x6f;&#110;&#x2d;&#109;&#101;&#100;&#105;&#97;&#46;&#99;&#x61;</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -129,7 +133,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>July 2012</li>
<li class='tc'>December 2013</li>
<li class='tr'>git-changelog(1)</li>
</ol>

View file

@ -15,6 +15,10 @@ git-changelog(1) -- Generate the changelog report
Show commit logs from the current version.
--no-merges
Filters out merge commits (commits with more than 1 parent) from generated changelog.
## EXAMPLES
* Updating changelog file: