git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak@voltaire.com>
To: Junio C Hamano <junkio@cox.net>
Cc: Matthias Urlichs <smurf@smurf.noris.de>, git@vger.kernel.org
Subject: [PATCH] git-svnimport.perl: fix for 'arg list too long...'
Date: Wed, 1 Feb 2006 17:53:31 +0200	[thread overview]
Message-ID: <20060201155331.GE18078@sashak.voltaire.com> (raw)

Hello,

This fixes 'arg list too long' problem when passed to git-ls-files.

Sasha.


This fixes 'arg list too long..' problem with git-ls-files.

Note that second arg list separation loop (with 'git-update-index') is
needed since git-ls-files arguments can be directories.

Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>

diff --git a/git-svnimport.perl b/git-svnimport.perl
index 6e3a44a..b6799d8 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -546,23 +546,30 @@ sub commit {
 			}
 		}
 
-		if(@old) {
-			open my $F, "-|", "git-ls-files", "-z", @old or die $!;
-			@old = ();
+		while(@old) {
+			my @o1;
+			if(@old > 55) {
+				@o1 = splice(@old,0,50);
+			} else {
+				@o1 = @old;
+				@old = ();
+			}
+			open my $F, "-|", "git-ls-files", "-z", @o1 or die $!;
+			@o1 = ();
 			local $/ = "\0";
 			while(<$F>) {
 				chomp;
-				push(@old,$_);
+				push(@o1,$_);
 			}
 			close($F);
 
-			while(@old) {
+			while(@o1) {
 				my @o2;
-				if(@old > 55) {
-					@o2 = splice(@old,0,50);
+				if(@o1 > 55) {
+					@o2 = splice(@o1,0,50);
 				} else {
-					@o2 = @old;
-					@old = ();
+					@o2 = @o1;
+					@o1 = ();
 				}
 				system("git-update-index","--force-remove","--",@o2);
 				die "Cannot remove files: $?\n" if $?;

             reply	other threads:[~2006-02-01 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 15:53 Sasha Khapyorsky [this message]
2006-02-01 20:27 ` [PATCH] git-svnimport.perl: fix for 'arg list too long...' Junio C Hamano
2006-02-01 21:54   ` Sasha Khapyorsky
2006-02-01 22:50     ` Junio C Hamano
2006-02-01 23:50       ` Matthias Urlichs
2006-02-02 14:26       ` Sasha Khapyorsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060201155331.GE18078@sashak.voltaire.com \
    --to=sashak@voltaire.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=smurf@smurf.noris.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).