* [PATCH 0/2] WWW + "lei q --stdin": support git approxidate
@ 2021-02-10 19:57 6% Eric Wong
2021-02-10 19:57 7% ` [RFC 2/2] search: disallow spaces in argv approxidate queries Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-02-10 19:57 UTC (permalink / raw)
To: meta
1/2 is something I've wanted since 2015. It could be done in a
less janky way if we didn't have to spawn git-rev-parse(1)
(libgit2 doesn't expose git__date_parse) AND if we didn't need
to support both XS and SWIG Xapian bindings.
But it's stable enough performance-wise for now with a single
git(1) process that I don't worry about making it public-facing
in WWW.
I'm not completely sure about 2/2, but I figure lei maintaining
consistency with WWW is slightly more important that consistency
with git (and git doesn't use mairix-like prefixes :P).
I also don't want to muck around too much with how Xapian does
quoted phrases
Eric Wong (2):
search: use git approxidate in WWW and "lei q --stdin"
search: disallow spaces in argv approxidate queries
lib/PublicInbox/Isearch.pm | 1 +
lib/PublicInbox/LeiQuery.pm | 8 +++++++-
lib/PublicInbox/Mbox.pm | 1 +
lib/PublicInbox/Search.pm | 37 ++++++++++++++++++++++++++---------
lib/PublicInbox/SearchView.pm | 3 ++-
t/lei-externals.t | 2 +-
t/psgi_search.t | 37 ++++++++++++++++++++---------------
t/search.t | 25 +++++++++++++++++++++++
8 files changed, 86 insertions(+), 28 deletions(-)
^ permalink raw reply [relevance 6%]
* [RFC 2/2] search: disallow spaces in argv approxidate queries
2021-02-10 19:57 6% [PATCH 0/2] WWW + "lei q --stdin": support git approxidate Eric Wong
@ 2021-02-10 19:57 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-02-10 19:57 UTC (permalink / raw)
To: meta
This is for consistency with --stdin and WWW front ends
which can't distinguish between phrase searches and
prefix ranges used for d:/dt:/rt:.
In any case, I expect users on the lei command-line are more
likely to use `5.days.ago' instead of `"5 days ago"'
---
lib/PublicInbox/Search.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 8e4cce33..520aa31d 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -337,7 +337,7 @@ sub query_argv_to_string {
my (undef, $git, $argv) = @_;
my $to_parse;
my $tmp = join(' ', map {;
- if (s!\b(d|rt|dt):([[:print:]]+)\z!date_parse_prepare(
+ if (s!\b(d|rt|dt):(\S+)\z!date_parse_prepare(
$to_parse //= [], $1, $2)!sge) {
$_;
} elsif (/\s/) {
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-02-10 19:57 6% [PATCH 0/2] WWW + "lei q --stdin": support git approxidate Eric Wong
2021-02-10 19:57 7% ` [RFC 2/2] search: disallow spaces in argv approxidate queries Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).