Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle trunk branches tags in the middle of svn url #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions git-svn-clone-externals
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ function call()
function do_clone()
{
test -d .git_externals || return 1
module=`echo $remote_url|sed 's,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\1,'`
branch=`echo $remote_url|sed 's,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\2,'|sed 's,^/,,'`
module=`echo $remote_url|sed 's,\(.*\)\(/trunk.*\|/branch.*\|/tag.*\),\1,'`
branch=`echo $remote_url|sed 's,\(.*\)\(/trunk.*\|/branch.*\|/tag.*\),\2,'|sed 's,^/,,'`
suffix=`echo $branch|sed 's,^\(trunk\|branches\|tags\)\(.*\),\2,'`
if [[ $branch = $remote_url ]]; then
branch=""
fi
Expand All @@ -41,15 +42,16 @@ function do_clone()
# additional options for git-svn
call git svn clone "$revision" "$module" "$local_directory"
else
call git svn clone "$revision" "$module" -T trunk -b $brch -t $tags "$local_directory"
call git svn clone "$revision" "$module" -T trunk$suffix -b $brch$suffix -t $tags$suffix "$local_directory"
fi

fi
(
branch="$(echo ${branch}|sed 's,/$,,')"
if [ -n "$branch" ]; then
cd "$local_directory"
call git reset --hard $branch
branchbase=`echo $branch | sed "s,$suffix,,"`
call git reset --hard $branchbase
fi
)
)
Expand Down
8 changes: 4 additions & 4 deletions git-svn-externals-update
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

for dir in *; do
for dir in `find . -regex "./.*/.*.git" -type d -exec dirname {} \;`; do
if [ -d $dir ]; then
cd $dir
pushd $dir
echo $dir
git svn fetch
git svn rebase
cd ..
popd
fi
done
done