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

Bug fix + tiny option #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions git-svn-clone-externals
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ set -e
toplevel_directory="$(git rev-parse --show-cdup)"
[ -n "$toplevel_directory" ] && { echo "please run from the toplevel directory"; exit 1; }

# Specify revision in command line (e.g. -rHEAD)
# It only affects those svn externals that are not tied to a specific revision
revision="$1"

function call()
{
Expand All @@ -27,7 +30,8 @@ function do_clone()
if [ -d "$local_directory" ]; then
(
cd "$local_directory"
call git svn fetch --all
call git svn fetch "$revision"
call git svn rebase
)
else
tags="tags"
Expand Down Expand Up @@ -96,12 +100,17 @@ function is_excluded()
}


git svn show-externals|grep -vE '#|^$'|while read -a words
declare -a lines
while read -a words ; do
lines[${#lines[@]}]=${words[*]}
done < <(git svn show-externals | grep -vE '#|^$')

for words in "${lines[@]}"
do
words=($words)
[ -z "${words[*]}" ] && continue

local_directory="$(echo ${words[0]}|sed 's,^/,,')"
revision=""
remote_url="${words[1]}"

check_excluded=$(is_excluded $local_directory)
Expand Down