added plugin to create git changelog and formatted code
parent
1fbd91ebf9
commit
92d814b2f6
|
|
@ -273,3 +273,38 @@ function gitignore-reload() {
|
||||||
echo >&2 "Files readded. Commit your new changes now."
|
echo >&2 "Files readded. Commit your new changes now."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function git-changelog(){
|
||||||
|
about 'Creates the git changelog from one point to another by date'
|
||||||
|
group 'git'
|
||||||
|
example '$ git-changelog origin/master...origin/release [md|txt]'
|
||||||
|
|
||||||
|
if [[ "$1" != *"..."* ]]
|
||||||
|
then
|
||||||
|
echo "Please include the valid 'diff' to make changelog"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local NEXT=$(date +%F)
|
||||||
|
|
||||||
|
if [[ "$2" == "md" ]]
|
||||||
|
then
|
||||||
|
echo "# CHANGELOG $1"
|
||||||
|
|
||||||
|
git log $1 --no-merges --format="%cd" --date=short | sort -u -r | while read DATE ; do
|
||||||
|
echo
|
||||||
|
echo "### $DATE"
|
||||||
|
GIT_PAGER=cat git log --no-merges --format=" * (%h) %s by [%an](mailto:%ae)" --since="$DATE 00:00:00" --until="$DATE 24:00:00"
|
||||||
|
NEXT=$DATE
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "CHANGELOG $1"
|
||||||
|
echo ----------------------
|
||||||
|
git log $1 --no-merges --format="%cd" --date=short | sort -u -r | while read DATE ; do
|
||||||
|
echo
|
||||||
|
echo [$DATE]
|
||||||
|
GIT_PAGER=cat git log --no-merges --format=" * (%h) %s by %an <%ae>" --since="$DATE 00:00:00" --until="$DATE 24:00:00"
|
||||||
|
NEXT=$DATE
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue