Updates for ODL Neon
[ccsdk/distribution.git] / dgbuilder / git_scripts / gitlog
1 if [ "$#" != "1" ]
2 then
3         echo "Usage $0 full_path_to_the_source_file"
4         exit
5 fi
6 fileName=$(basename $1)
7 dirName=$(dirname $1)
8 cd $dirName
9 glog=$(git log --pretty=format:'%H %cD %an %s' -n 25 ${fileName}|awk ' ORS=" "{print \
10 "\n{\n" \
11 "\"commit\": \"" $1 "\",\n" \
12 "\"date\": \""$2 " "$3" "$4" "$5 " "$6 "\",\n" \
13 "\"author\": \"" $8 ", "$9 "\",\n" \
14 "\"comment\": \""} { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print s } { print  "\"\n},"}')
15 echo "["
16 update_glog=$(echo $glog|sed -e 's/,$//g')
17 echo $update_glog
18 echo "]"