newer svn versions place full copies of each file into a git-like
directory structure in .svn. we don't want these in our git repo,
and now when we do git add '*' after a source file was deleted,
git recognized that the file has been "moved" to
.svn/pristine/aa/
bbccddeeff001122334455, which causes
git status --porcelain to print a line like:
R src/fpu/fpu_load.h -> .svn/pristine/ec/
ec26b5f30d239f03eb6c932c8b94658dcf84218d.svn-base
which our previous grep | cut command would misinterpret as having to
delete the first filename printed here.
@@ -90,8 +90,13 @@ git add --all . # . adds *all* files, even dotfiles and dirs not listed with *,
# unstage our own files from repo
# we can't check in .gitignore, since that might at some point be added in a commit
-for x in $(git status --porcelain | grep ' \.svnup/' | cut -b 4-) ; do
+for x in $(git status --porcelain | awk '/ \.svn\// || / \.svnup\// {for(i=1;i<=NF;++i) if($i ~ /\.svn\// || $i ~/\.svnup\//) {print($i); break;}}') ; do
git rm --cached "$x" >/dev/null
+ret=$?
+if test $ret != 0 ; then
+ echo "got error trying to git rm $x"
+ exit 1
+fi
done
$SVN log -r "$rev" . > "$tmp1"