I'm currently migrating repositories and have created some key variables to use in my Subversion commit, the most important of those are Commit message, and Date I am trying to commit with those variables as part of the svn ci
operation, the message is fairly easy as I can use svn ci -m"$(LOGMSG)"
for the message, but I have no idea how to explicitly add the DATE and AUTHOR fields to the commit, could someone help?
for (( r=$CURREV; r<$ENDREV+1; r++ ))
do
git svn fetch -r $CURREV
# move whitelists subversion folder
find "$GIT_FOLDER" \
-mindepth 1 \
-maxdepth 1 \
-regextype posix-egrep \
-not -regex ".*/(${EXCLUDE_PATTERN})$" \
-exec mv -t "$SVN_FOLDER" '{}' '+'
# set opts for SVN logging
CID=$(git log --format=oneline |awk '{print $1}')
AUTHOR='Jd Daniel <jdaniel@erado.com>'
DATE=$(git log --date=iso |grep 'Date' |awk -v N=2 '{sep=""; for (i=N; i<=NF; i++) {printf("%s%s",sep,$i); sep=OFS}; printf("\n")}')
LOGMSG=$(git log --oneline |awk -v N=2 '{sep=""; for (i=N; i<=NF; i++) {printf("%s%s",sep,$i); sep=OFS}; printf("\n")}')
# move to svn
cd $SVN_FOLDER
ADD=$(svn st |grep '?\|M' |awk '{printf "%s ", $2}'); [ -z "$ADD" ] || svn add $ADD
REM=$(svn st |grep 'D\|!' |awk '{printf "%s ", $2}'); [ -z "$REM" ] || svn rm $REM
# do commit
svn ci -m 'GIT ID: '$CID$'\n'$LOGMSG
break # just on rev for now
done