git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] Fix large-scale exports by 'git-svndump'

From
SYSergey Yanovich <ynvich@gmail.com>
Date
Jun 18, 2007, 12:14 UTC
Message-ID
<11821688462083-git-send-email-ynvich@gmail.com>
In-Reply-To
<11821688462290-git-send-email-ynvich@gmail.com>
* Split revision list using 'tail' shell command.
* Wrap multiple list generation in an endless cycle with 'while true'.
  Exit from cycle when the current list is empty.
* Improve handling of merges by adding '--no-merges --topo-order'i
  arguments to the list generating command.
Signed-off-by: Sergey Yanovich <ynvich@gmail.com>
---
 git-svndump-sync.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/git-svndump-sync.sh b/git-svndump-sync.sh
index e1c04e1..516edaf 100755
--- a/git-svndump-sync.sh
+++ b/git-svndump-sync.sh
@@ -70,7 +70,14 @@ if test -f $GIT_DIR/svndump/last ; then
 	fi
 fi
 
-list=`GIT_DIR=$GIT_DIR git-rev-list $commit $start`
+while true ; do
+
+list=`GIT_DIR=$GIT_DIR git-rev-list --no-merges --topo-order $commit $start |
+tail -n 8`
+
+if test -z "$list" ; then
+	exit 0
+fi
 
 diffs=""
 for c in $list ; do
@@ -79,7 +86,14 @@ done
 
 for c in $diffs ; do
 	GIT_DIR=$GIT_DIR git-svn commit-diff -r$rev $last $c $url
+	if test $? -ne 0 ; then
+		exit $?
+	fi
 	echo "$c" > $GIT_DIR/svndump/last
 	last=$c
 	let rev++
 done
+
+start=^$last
+
+done
-- 
1.5.2.1
Previous: Sergey YanovichNext: Johannes Sixt
Message 4 of 11 in “git tool to keep a subversion mirror”
  1. Sergey YanovichJun 18, 2007
  2. 1/3 Accept root <tree-ish> in 'git-svn commit-diff'Sergey Yanovich, Jun 18, 2007
  3. 2/3 'git-svndump'Sergey Yanovich, Jun 18, 2007
  4. 3/3 Fix large-scale exports by 'git-svndump'Sergey Yanovich, Jun 18, 2007
  5. Johannes SixtJun 18, 2007
  6. Charlie ShepherdJun 18, 2007
  7. Johannes SixtJun 18, 2007
  8. Eric WongJun 20, 2007
  9. Sergey YanovichJun 20, 2007
  10. Eric WongJun 20, 2007
  11. Sergey YanovichJun 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.