unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/2] minor solver updates
@ 2024-05-11 23:29 Eric Wong
  2024-05-11 23:29 ` [PATCH 1/2] solver: quiet complex regexp warning for old Perl Eric Wong
  2024-05-11 23:29 ` [PATCH 2/2] solver: eliminate a few more git path lookups Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-11 23:29 UTC (permalink / raw)
  To: meta

Eric Wong (2):
  solver: quiet complex regexp warning for old Perl
  solver: eliminate a few more git path lookups

 lib/PublicInbox/SolverGit.pm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] solver: quiet complex regexp warning for old Perl
  2024-05-11 23:29 [PATCH 0/2] minor solver updates Eric Wong
@ 2024-05-11 23:29 ` Eric Wong
  2024-05-11 23:29 ` [PATCH 2/2] solver: eliminate a few more git path lookups Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-11 23:29 UTC (permalink / raw)
  To: meta

I'm not sure when the actual recursion limit was removed,
but the warning was removed for Perl 5.37.1.  In any case,
it's probably not worth doing anything about for older Perls
it since it's rarely triggered and it seems nobody cares too
much about solver, anyways :<
---
 lib/PublicInbox/SolverGit.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 296e7d17..7984af43 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -136,6 +136,12 @@ sub extract_diff ($$) {
 	if ($cte =~ /\bquoted-printable\b/i && $part->crlf eq "\n") {
 		$s =~ s/\r\n/\n/sg;
 	}
+
+	# Quiet "Complex regular subexpression recursion limit" warning.
+	# Not much we can do about it, but it's no longer relevant to
+	# Perl 5.3x (the warning was removed in 5.37.1, and actual
+	# recursino sometime before then).
+	no warnings 'regexp';
 	$s =~ m!( # $1 start header lines we save for debugging:
 
 		# everything before ^index is optional, but we don't

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] solver: eliminate a few more git path lookups
  2024-05-11 23:29 [PATCH 0/2] minor solver updates Eric Wong
  2024-05-11 23:29 ` [PATCH 1/2] solver: quiet complex regexp warning for old Perl Eric Wong
@ 2024-05-11 23:29 ` Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-05-11 23:29 UTC (permalink / raw)
  To: meta

This eliminates a few more stat syscalls and malloc+free sequences.
---
 lib/PublicInbox/SolverGit.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 7984af43..b5f6b96e 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -13,7 +13,7 @@ use v5.10.1;
 use File::Temp 0.19 (); # 0.19 for ->newdir
 use autodie qw(mkdir);
 use Fcntl qw(SEEK_SET);
-use PublicInbox::Git qw(git_unquote git_quote);
+use PublicInbox::Git qw(git_unquote git_quote git_exe);
 use PublicInbox::IO qw(write_file);
 use PublicInbox::MsgIter qw(msg_part_text);
 use PublicInbox::Qspawn;
@@ -293,7 +293,7 @@ sub prepare_index ($) {
 
 	dbg($self, 'preparing index');
 	my $rdr = { 0 => $in };
-	my $cmd = [ qw(git update-index -z --index-info) ];
+	my $cmd = [ git_exe, qw(update-index -z --index-info) ];
 	my $qsp = PublicInbox::Qspawn->new($cmd, $self->{git_env}, $rdr);
 	$path_a = git_quote($path_a);
 	$self->{-msg} = "index prepared:\n$mode_a $oid_full\t$path_a";
@@ -473,7 +473,7 @@ sub apply_result ($$) { # qx_cb
 		skip_identical($self, $patches, $di->{oid_b});
 	}
 
-	my @cmd = qw(git ls-files -s -z);
+	my @cmd = (git_exe, qw(ls-files -s -z));
 	my $qsp = PublicInbox::Qspawn->new(\@cmd, $self->{git_env});
 	$self->{-cur_di} = $di;
 	qsp_qx $self, $qsp, \&ls_files_result;
@@ -484,7 +484,7 @@ sub do_git_apply ($) {
 	my $patches = $self->{patches};
 
 	# we need --ignore-whitespace because some patches are CRLF
-	my @cmd = (qw(git apply --cached --ignore-whitespace
+	my @cmd = (git_exe, qw(apply --cached --ignore-whitespace
 			--unidiff-zero --whitespace=warn --verbose));
 	my $len = length(join(' ', @cmd));
 	my $di; # keep track of the last one for "git ls-files"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-11 23:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-11 23:29 [PATCH 0/2] minor solver updates Eric Wong
2024-05-11 23:29 ` [PATCH 1/2] solver: quiet complex regexp warning for old Perl Eric Wong
2024-05-11 23:29 ` [PATCH 2/2] solver: eliminate a few more git path lookups Eric Wong

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 read-only IMAP folder(s) and NNTP newsgroup(s).