mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Add --no-merges option to changelog
--no-merges allows for generating changelog without information about merge commits
This commit is contained in:
parent
0faaec7ce9
commit
31bbed4ac8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ _git_bug(){
|
|||
}
|
||||
|
||||
_git_changelog(){
|
||||
__gitcomp "-l -t --list --tag"
|
||||
__gitcomp "-l -t --list --tag --no-merges"
|
||||
}
|
||||
|
||||
_git_contrib(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue