tools: Improve changelog generation
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
Change-Id: I94057b3ab0a6cd00ea4d02ccab8547d28e7c5ead
diff --git a/tools/changelog b/tools/changelog
index 3e5e40a..2b002b1 100755
--- a/tools/changelog
+++ b/tools/changelog
@@ -24,10 +24,15 @@
echo '====================' >> $Changelog;
echo >> $Changelog;
- # Cycle through every repo to find commits between 2 dates
- CURRENT_PATH="$(realpath `pwd`)"
- repo forall -c "GIT_LOG=\`git log --oneline --after=$After_Date --until=$Until_Date\` ; if [ ! -z \"\$GIT_LOG\" ]; then printf '\n * '; realpath \`pwd\` | sed 's|^$CURRENT_PATH/||' ; echo \"\$GIT_LOG\"; fi" >> $Changelog
- echo >> $Changelog;
+while read path;
+do
+ Git_log=`git --git-dir ./${path}/.git log --after=$After_Date --until=$Until_Date --pretty=tformat:"%h %s [%an]" --abbrev-commit --abbrev=7`
+ if [ ! -z "${Git_log}" ]; then
+ echo "\n* ${path}\n${Git_log}\n" >> $Changelog;
+ fi
+done < ./.repo/project.list;
+
+echo "" >> $Changelog;
done
sed -i 's/project/ */g' $Changelog