Skip to content

Commit b618b80

Browse files
author
victorar
committedJul 4, 2017
bin: improve git-svn-sync
1 parent 0b4086b commit b618b80

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

‎bin/git-svn-sync

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@
77
# Useful resources:
88
# * https://www.atlassian.com/git/tutorials/migrating-convert
99
# * http://www.janosgyerik.com/practical-tips-for-using-git-with-large-subversion-repositories/
10+
# * https://github.com/varhub/git_status
1011
#
1112
# Clone command:
1213
# $ git svn clone --stdlayout -A authors.txt <svn_url> <local name>
1314
# - stdlayout is mandatory (see man for non canonical svn repos)
1415
# - authors file must be complete
1516

17+
18+
test -z "$(git status --short --porcelain)"
19+
dirty=$?
20+
1621
set -e
1722

18-
git stash && git svn rebase && git stash pop
23+
if [ $dirty -gt 0 ]; then
24+
echo "Found dirty workspace, stashing it..."
25+
git stash --all --include-untracked
26+
fi
27+
28+
git svn rebase
29+
30+
[ $dirty -gt 0 ] && git stash pop
31+
echo "git SVN sync OK."

0 commit comments

Comments
 (0)