Here is a shell for printing committed person's:
- Revision number
- Name
- Date of commit
- Files committed.
- committing comment
- Date
I just made for my usage. May be helpful for you too.
Do as follows.
create a file
$ vi svn_get_user_committed_files_details.sh
press i
then copy & paste the following as it is. And then make the shell executable with the command chmod.
[Don't forget to change PROJECT path. :)]
Usage :
$ sh svn_get_user_committed_files_details.sh anySvnUName
or
$ sh svn_get_user_committed_files_details.sh
#!/bin/bash
#######Things need to change######### [
PROJECT="/home/smily/workspace/MyProj"
#Date format should be YYYY-MM-DD
DateFrom="2011-12-20"
#DateTo can be in YYYY-MM-DD or HEAD
DateTo="HEAD"
#######Things need to change######### ]
svnfile_log_all="/tmp/svnfile_log_all.txt"
svnListUNames="/tmp/svnListUNames.txt"
svnUserCommitted="/tmp/svnUserCommitted.txt"
uName="$1"
[ $DateTo == "HEAD" ] && DateFromTo="-r {$DateFrom}:HEAD" || DateFromTo="-r {$DateFrom}:{$DateTo}"
[ -f $svnfile_log_all ] && rm -f $svnfile_log_all
[ -f $svnListUNames ] && rm -f $svnListUNames
[ -f $svnUserCommitted ] && rm -f $svnUserCommitted
echo -e "\nPlease wait..\n"
svn log $DateFromTo -v $PROJECT > $svnfile_log_all
if [ -z $uName ]; then
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./ {print user} ' | grep -v "^$" |sort | uniq >> $svnListUNames
else
if [ `cat $svnfile_log_all | grep "$uName" | wc -l` -gt "0" ]; then
echo $uName > $svnListUNames
else
echo -e "\n>>>>>user: $uName not committed any files.<<<<<"
exit 0
fi
fi
echo -e "\n\nRepo Name: `cat $PROJECT/.svn/entries | grep "http://" | head -1`" >> $svnUserCommitted
while read uName
do
echo -e "\n$uName committed files\n======================" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' | grep -E "^ M|^ G|^ A|^ D|^ C|^ U" | awk '{print $2}' | sort >> $svnUserCommitted
echo -e "\n\nIn Detail:\n==========" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' >> $svnUserCommitted
echo -e "\n"
done < $svnListUNames
echo -e "Log is in : $svnUserCommitted\n"
cat $svnUserCommitted
Changes / suggestions expected ..