mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Merge pull request #225 from pmalek/master
Fixed git-changelog errors on first usage
This commit is contained in:
commit
ef00c0c2c6
|
|
@ -28,7 +28,8 @@ DATE=`date +'%Y-%m-%d'`
|
|||
HEAD="\n$TAG / $DATE\n==================\n\n"
|
||||
|
||||
if $LIST; then
|
||||
version=$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))
|
||||
lasttag=$(git rev-list --tags --max-count=1 2>/dev/null)
|
||||
version=$(git describe --tags --abbrev=0 $lasttag 2>/dev/null)
|
||||
if test -z "$version"; then
|
||||
git log $GIT_LOG_OPTS --pretty="format: * %s"
|
||||
else
|
||||
|
|
@ -39,7 +40,7 @@ fi
|
|||
|
||||
CHANGELOG=$FILE
|
||||
if test "$CHANGELOG" = ""; then
|
||||
CHANGELOG=`ls | egrep 'change|history' -i`
|
||||
CHANGELOG=`ls | egrep 'change|history' -i|head -n1`
|
||||
if test "$CHANGELOG" = ""; then
|
||||
CHANGELOG='History.md';
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue