You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to git-meld a commit that has thousands of files in it the safe_cmd() call containing the git archive shell command fails with an error == -1. I'm not sure what the exact problem is, because if I put the command that failed from the Perl script into a bash script and run it, it works.
But, if I change copy_file_names_tree() to call git archive with smaller batches of files it seems to work.
A patch follows; keep in mind that Perl is a non-native language to me, so it's probably less than idiomatic.
diff --git a/git-meld.pl b/git-meld.pl
index e581781..f98a2b6 100755
--- a/git-meld.pl
+++ b/git-meld.pl
@@ -146,8 +146,17 @@ sub copy_files_named_tree($$$) {
if (scalar @$file_list == 0) {
return;
}
- my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
- safe_cmd("cd \$(git rev-parse --show-toplevel) && git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+ #my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
+ #safe_cmd("cd \$(git rev-parse --show-toplevel) && git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+
+ safe_cmd("cd \$(git rev-parse --show-toplevel)");
+ my @flist = @$file_list;
+
+ while (scalar @flist != 0) {
+ my @sub_list = splice @flist, 0, 200;
+ my $escaped_file_list = join(" ", map{shell_escape($_)} @sub_list);
+ safe_cmd("git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+ }
}
# Links the files given as a list in the first argument from the working
The text was updated successfully, but these errors were encountered:
Thanks for the patch! Was a great help. After a permission change of the whole repo I couldn't diff the branches before/after the change. Would be great to put this into the master branch..
When I try to git-meld a commit that has thousands of files in it the
safe_cmd()
call containing thegit archive
shell command fails with an error == -1. I'm not sure what the exact problem is, because if I put the command that failed from the Perl script into a bash script and run it, it works.But, if I change
copy_file_names_tree()
to callgit archive
with smaller batches of files it seems to work.A patch follows; keep in mind that Perl is a non-native language to me, so it's probably less than idiomatic.
The text was updated successfully, but these errors were encountered: