Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Define a bunch of variables
- DIR="`pwd`"
- REPOLIST=".repo/project.list"
- TMP="$DIR/tmp"
- BRANCHFROM="$1"
- BRANCHTO="$2"
- LOGPATH="$DIR/$BRANCHFROM-$BRANCHTO.log"
- # Check if aosp or caf
- if echo "$DIR" | grep -i "caf" ;
- then
- SOURCE="caf"
- elif echo "$DIR" | grep -i "aosp" ;
- then
- SOURCE="tags"
- fi
- # define branch or tag
- FROM="$SOURCE"/"$BRANCHFROM"
- TO="$SOURCE"/"$BRANCHTO"
- # Log function
- function LOG()
- {
- # Stupid way to skip over empty repos
- rm -rf $TMP
- git log --no-merges $FROM...$TO > $TMP
- if [ -s "$TMP" ] ;
- then
- # Format
- echo "" >> $LOGPATH
- echo "#" >> $LOGPATH
- echo "##" >> $LOGPATH
- echo "$pathline" >> $LOGPATH
- echo "##" >> $LOGPATH
- echo "#" >> $LOGPATH
- echo "" >> $LOGPATH
- # Actual log command
- git log --no-merges --pretty=oneline $FROM..$TO >> $LOGPATH
- fi # End stupid way to skip over empty repos
- }
- # Lets make sure log file is clean
- rm -f $LOGPATH
- # We start
- echo "Generating LOG for '$SOURCE' from '$BRANCHFROM' to '$BRANCHTO'"
- echo "Start" > $LOGPATH
- echo "Git log from '$BRANCHFROM' to '$BRANCHTO'" >> $LOGPATH
- # Use repo list
- cat $REPOLIST |\
- # Loop to go through all repos until list is empty
- while read pathline; do
- pathline=$pathline
- cd "$pathline"
- LOG
- cd "$DIR"
- done # End loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement