Sasha Khapyorsky <sashak@voltaire.com> writes:I was commenting on the "while (@o1)" loop that splices at 50 when the list has more than 55 items to feed update-index. You could accumulate output from multiple invocations of ls-files and feed everything to a single "update-index --stdin" after the "while (@old)" loop is done. Batch of 50 vs a single batch may not matter though [*1*]. But you are right; that git-ls-files can get too many arguments unless you split like that. A casual skimming over the rest of the code tells me that this fixes the last instance of such a command invocation with too many arguments. Good catch. Smurf, I do not have problems with Sasha's patch. Are you OK if I apply it? -- >8 -- *1* I do not think this makes much of a difference but here is what I mean. diff --git a/git-svnimport.perl b/git-svnimport.perl index b6799d8..d76a595 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -546,7 +546,8 @@ sub commit { } } - while(@old) { + my @u = (); + while (@old) { my @o1; if(@old > 55) { @o1 = splice(@old,0,50); @@ -555,26 +556,19 @@ sub commit { @old = (); } open my $F, "-|", "git-ls-files", "-z", @o1 or die $!; - @o1 = (); local $/ = "\0"; while(<$F>) { chomp; - push(@o1,$_); + push(@u,$_); } close($F); - - while(@o1) { - my @o2; - if(@o1 > 55) { - @o2 = splice(@o1,0,50); - } else { - @o2 = @o1; - @o1 = (); - } - system("git-update-index","--force-remove","--",@o2); - die "Cannot remove files: $?\n" if $?; - } } + open my $F, "|-", + qw(git-update-index --force-remove -z --stdin) + or die $!; + print $F "$_\0" for @u; + close $F or die $!; + while(@new) { my @n2; if(@new > 12) { - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Mattia Dongili | Re: Linux 2.6.21-rc6 |
| Greg Kroah-Hartman | [PATCH 024/196] mtd: Convert from class_device to device for MTD/mtdchar |
| Renato S. Yamane | Error -71 on device descriptor read/all |
| Chuck Ebbert | Why do so many machines need "noapic"? |
git: | |
| Mirko Stocker | Working with Git and CVS in a team. |
| Steffen Prohaska | Git-1.6.0.2-preview20080921 on Windows |
| Miles Bader | way to automatically add untracked files? |
| Tilman Sauerbeck | [BUG?] git log picks up bad commit |
| Brian A. Seklecki | sshd_config(5) PermitRootLogin yes |
| Jacob Yocom-Piatt | Re: Real men don't attack straw men |
| Parvinder Bhasin | BIND and CNAME-ing |
| Jerome Santos | sshd.config and AllowUsers |
| Patrick McHardy | pkt_sched: add DRR scheduler |
| ackman | RTL8169 driver no longer functioning with 8111b |
| Evgeniy Polyakov | [resend take 2 4/4] DST Makefile/Kconfig files. |
| Sami Farin | Linux 2.6.27.5 / SFQ/HTB scheduling problems |
| Kernel Panic when schedule is called | 2 hours ago | Linux kernel |
| VPN's on NetBSD | 15 hours ago | NetBSD |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 16 hours ago | Linux kernel |
| USB statistics | 18 hours ago | Linux kernel |
| Block Sub System query | 22 hours ago | Linux kernel |
| kernel module to intercept socket creation | 23 hours ago | Linux kernel |
| Image size changing during each build | 23 hours ago | Linux kernel |
| Soft lock bug | 1 day ago | Linux kernel |
| sysctl - dynamic registration problem | 1 day ago | Linux kernel |
| Question on swap as ramdisk partition | 1 day ago | Linux kernel |
