如何生成按日期分组的提交的变更日志,格式为:
[date today]
- commit message1
- commit message2
- commit message3
...
[date day+3]
- commit message1
- commit message2
- commit message3
...
(skip this day if no commits)
[date day+1]
- commit message1
- commit message2
- commit message3
...
[date since]
- commit message1
- commit message2
- commit message3
任何git log命令或智能bash脚本? 最佳答案
这很脏,但是我想出了脚本的工作版本:
#!/bin/bash
# Generates changelog day by day
NEXT=$(date +%F)
echo "CHANGELOG"
echo ----------------------
git log --no-merges --format="%cd" --date=short | sort -u -r | while read DATE ; do
echo
echo [$DATE]
GIT_PAGER=cat git log --no-merges --format=" * %s" --since=$DATE --until=$NEXT
NEXT=$DATE
done
关于git - git:每天的更新日志,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2976665/