Created
June 15, 2012 16:43
-
-
Save KhasMek/2937502 to your computer and use it in GitHub Desktop.
just a unclean version in case I ever need to look back.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sdate=${1} | |
cdate=`date +"%m_%d_%Y"` | |
rdir=`pwd` | |
# Check the date start range is set | |
if [ -z "$sdate" ]; then | |
echo "!!!!---- Start date not defined ----!!!!" | |
echo "Please define a start date in mm/dd/yyyy format." | |
read sdate | |
fi | |
# Find the directories to log | |
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" --since=$sdate --date-order) | |
project=$(git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//') | |
if [ -z "$log" ]; then | |
echo "Nothing updated on $project, skipping" | |
else | |
# Kinda not clean at all atm, but it'll do. | |
#project=$(git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//') | |
echo "Project name: $project" >> "$rdir"/Changelog_$cdate.txt | |
echo "" >> "$rdir"/Changelog_$cdate.txt | |
#log=$(git log --pretty="%an - %s" --since=$sdate --date-order) # | while read line | |
#do | |
echo "$log" >> "$rdir"/Changelog_$cdate.txt | |
echo "" >> "$rdir"/Changelog_$cdate.txt | |
echo "" >> "$rdir"/Changelog_$cdate.txt | |
#done | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment