forked from Oreo-Harpia/android_kernel_motorola_msm8916
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changelog.sh
executable file
·59 lines (52 loc) · 1.36 KB
/
changelog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
sdate=${1}
cdate=`date +"%m_%d_%Y"`
rdir=`pwd`
rm -rf changelog_*
clear
# Bash Color
green='\033[01;32m'
red='\033[01;31m'
blink_red='\033[05;31m'
restore='\033[0m'
echo -e "${red}"
echo " ---------- "
echo " / "
echo " \ "
echo " /-------- "
echo " \ "
echo " / "
echo " \ "
echo ''
echo " Welcome to HybridX Kernel changelog script! "
echo -e "${restore}"
# Check the date start range is set
if [ -z "$sdate" ]; then
echo ""
echo "Failed!"
echo "Add a date in mm/dd/yyyy format to count from..."
echo ""
fi
# Find the directories to log
echo "Starting date picking based on the input date..."
find $rdir -name .git | sed 's/\/.git//g' | sed 'N;$!P;$!D;$d' | while read line
do
cd $line
# Test to see if the repo needs to have a changelog written
log=$(git log --pretty="%an - %s" --no-merges --since=$sdate --date-order)
if [ -z "$log" ]; then
echo "Nothing updated on HybridX Kernel changelog, skipping..."
else
# Write the changelog
echo "Changelog is updated and written for $project..."
echo "Project: $project" >> "$rdir"/changelog_$cdate.log
echo "$log" | while read line
do
echo "$line" >> "$rdir"/changelog_$cdate.log
done
echo "" >> "$rdir"/changelog_$cdate.log
fi
done
echo -e "${red}"
echo "Changelog script for HybridX Kernel has finished."
echo -e "${restore}"