about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-27 03:38:41 +0000
committerEric Wong <e@80x24.org>2019-01-27 03:44:40 +0000
commitba2253e9a04f595f43889235264ed26b75c57347 (patch)
treef6e3745354253db9126d81dc922c2df04be8b4e4 /lib/PublicInbox/SolverGit.pm
parent41f03a3bd4b13dfa4fcf103d02c04a7cd56cd6c2 (diff)
downloadpublic-inbox-ba2253e9a04f595f43889235264ed26b75c57347.tar.gz
Might as well, since the only constraint is filesystem space
for temporary files for public-inbox-httpd users.

-httpd can fairly share work across clients with our use of
psgi_qx; and there's a recent patch series in git@vger with 64
patches in sequence.
Diffstat (limited to 'lib/PublicInbox/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index dfc28d26..39acbe41 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -24,6 +24,14 @@ use URI::Escape qw(uri_escape_utf8);
 use POSIX qw(sysconf _SC_ARG_MAX);
 my $ARG_SIZE_MAX = (sysconf(_SC_ARG_MAX) || 4096) - 2048;
 
+# By default, "git format-patch" generates filenames with a four-digit
+# prefix, so that means 9999 patch series are OK, right? :>
+# Maybe we can make this configurable, main concern is disk space overhead
+# for uncompressed patch fragments.  Aside from space, public-inbox-httpd
+# is otherwise unaffected by having many patches, here, as it can share
+# work fairly.  Other PSGI servers may have trouble, though.
+my $MAX_PATCH = 9999;
+
 # di = diff info / a hashref with information about a diff ($di):
 # {
 #        oid_a => abbreviated pre-image oid,
@@ -425,7 +433,7 @@ sub di_url ($$) {
 sub resolve_patch ($$) {
         my ($self, $want) = @_;
 
-        if (scalar(@{$self->{patches}}) > $self->{max_patch}) {
+        if (scalar(@{$self->{patches}}) > $MAX_PATCH) {
                 die "Aborting, too many steps to $self->{oid_want}";
         }
 
@@ -477,7 +485,6 @@ sub new {
         bless {
                 gits => $ibx->{-repo_objs},
                 user_cb => $user_cb,
-                max_patch => 100,
 
                 # TODO: config option for searching related inboxes
                 inboxes => [ $ibx ],