blob: f3f2d464e0447fafd6424dd49cf8c54391264b9c [file] [log] [blame]
#!/bin/bash
#
# this was an attempt to fix some simple branch commits
#TAG=R3_6
#BR=R3_5_maintenance
for BR in $( cat l.txt ); do
#git checkout $BR >/dev/null 2>&1
rm -f t1.txt
git log --format="format:%H:%an" $BR | grep cvs2svn >t1.txt
CMT=$( head -1 t1.txt | cut -f1 -d: )
if grep cvs2svn t1.txt >/dev/null; then
git log -1 --format="format:%H:%an:%b" $CMT >t1.txt
if grep ^Cherrypick t1.txt >/dev/null; then
grep ^Cherrypick t1.txt | sed "s/^/commit $CMT /g"
else
if [ -z "$(git log -1 --merges --format="format:%h" $CMT)" ]; then
PT=$( git log -1 --format="format:%an" "${CMT}^1" )
if [ "$PT" != cvs2svn ]; then
echo git rebase --onto "${CMT}^1" "${CMT}"
else
echo "cvs2svn parent: $BR commit: $CMT"
fi
else
echo "Found 2 parents: $BR commit: $CMT"
fi
fi
else
echo "Tag branch: $BR commit: $CMT"
fi
done