From 6c77740a801b0f30f7e9cb158d26376d7288ed7f Mon Sep 17 00:00:00 2001 From: artemave Date: Tue, 14 Jun 2011 17:38:56 +0100 Subject: [PATCH 1/3] No longer broken when git svn goes interactive (e.g. prompting for ssl certificate password) --- git-svn-clone-externals | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git-svn-clone-externals b/git-svn-clone-externals index f374f26..f6e965c 100755 --- a/git-svn-clone-externals +++ b/git-svn-clone-externals @@ -96,8 +96,14 @@ 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,^/,,')" @@ -134,3 +140,4 @@ do done + From 9c174c28c0d86c48da1fa30205f4d702ad52cb08 Mon Sep 17 00:00:00 2001 From: artemave Date: Tue, 14 Jun 2011 17:42:47 +0100 Subject: [PATCH 2/3] option to specify revision so that big repositories don't take ages to check out --- git-svn-clone-externals | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/git-svn-clone-externals b/git-svn-clone-externals index f6e965c..04c8b57 100755 --- a/git-svn-clone-externals +++ b/git-svn-clone-externals @@ -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() { @@ -27,7 +30,7 @@ function do_clone() if [ -d "$local_directory" ]; then ( cd "$local_directory" - call git svn fetch --all + call git svn fetch "$revision" ) else tags="tags" @@ -107,7 +110,6 @@ do [ -z "${words[*]}" ] && continue local_directory="$(echo ${words[0]}|sed 's,^/,,')" - revision="" remote_url="${words[1]}" check_excluded=$(is_excluded $local_directory) @@ -140,4 +142,3 @@ do done - From 0f2590f27c86f056ca5a67e1926e0dd8802c7a5d Mon Sep 17 00:00:00 2001 From: artemave Date: Mon, 27 Jun 2011 17:00:54 +0100 Subject: [PATCH 3/3] make git-svn-clone-externals update existing externals --- git-svn-clone-externals | 1 + 1 file changed, 1 insertion(+) diff --git a/git-svn-clone-externals b/git-svn-clone-externals index 04c8b57..bd72164 100755 --- a/git-svn-clone-externals +++ b/git-svn-clone-externals @@ -31,6 +31,7 @@ function do_clone() ( cd "$local_directory" call git svn fetch "$revision" + call git svn rebase ) else tags="tags"