我有一个存储库,我想在其中提及每个更改、发行说明和日志文件。
如何生成这些文件?
如果您正在寻找创建构建说明,您可以使用
git log LAST_TAG..THIS_TAG
如果您的提交具有 JiraID 之类的内容或您可以做的任何事情
git log --grep JiraID LAST_TAG..THIS_TAG然后以任何方式解析它。
您可以使用简单的 bash 脚本来生成 ReleaseNotes.txt。只需将脚本复制粘贴到代码的结帐目录并运行即可。
#!/bin/bash
#This script will generate the release notes from the commits
#It will discard prints oF automatic Merges and Pull Requests commits.
#It will show all the Commits date wise and sorted
DATE=
git log --pretty=format:"%ad || %h || %s || Author:%an " --date=short | sort -r | while read line
do
temp=`echo $line | egrep -v '(Automatic merge from|Merge pull request|Merge conflict from|Resolve Conflict From)'`
if [ "$temp" = "" ]
then
continue
else
NEWDATE=`echo $temp | awk '{print $1}'`
if [ "$NEWDATE" = "$DATE" ]
then
echo $temp | awk '{$1="";$2="";print}' >> releaseNotes.txt
else
echo >> releaseNotes.txt
DATE=$NEWDATE
echo `date --date=$DATE +%d-%B-%Y` >> releaseNotes.txt
echo $temp | awk '{$1="";$2="";print}' >> releaseNotes.txt
fi
fi
done