user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [PATCH 3/3] search: rectify comment (rt: documented since 738c4a65719e)
  2023-10-16 11:33  6% ` [PATCH 3/3] search: rectify comment (rt: documented since 738c4a65719e) Štěpán Němec
@ 2023-10-16 21:39  7%   ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-10-16 21:39 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: meta

Štěpán Němec <stepnem@smrk.net> wrote:
> Fixes: 738c4a65719e ("www: various help text updates")
> ---
> On a related note, there's this comment in LeiXSearch.pm:312:
> 
>   # this should really be rt: (received-time), but no stable
>   # public-inbox releases support it, yet.
>   my $dt = 'dt:'.strftime('%Y%m%d%H%M%S', gmtime($lr)).'..';
> 
> So I went all "hey, it's been 3 releases with rt:, let's do this",
> and suddenly, `lei up` stopped getting any updates :-]

> The problem is that the date syntax handling for d:, dt: and rt: is not
> the same (date_parse_prepare in Search.pm), which doesn't seem ideal to
> me, either, but maybe that's intentional/necessary?

Yeah, probably: "rt:$lr.."; is correct.

It's historical baggage since rt: wasn't really used until we
got IMAP (2020); and we didn't have user-friendly approxidate
parsing until 2021.

d: and dt: had to be at least usable before 2021, so it's more
usable in "raw" form.

It's expensive to reindex so it's not something I'm inclined to
force users into doing, either...

d: was a short-sighted mistake and redundant.  I suppose we
could stop indexing d: at some point (like we do with --skip-docdata)
and translate all (not just most) d: into dt: in the parser.

> On a totally unrelated note, this patch is a nice example of how
> --diff-algorithm=histogram (which I use by default) sometimes produces
> diffs that are both longer and more confusing than with any other
> (git-provided) algorithm:

Heh, I've never touched --diff-algorithm.  But I sometimes pipe
messages to `lei rediff -W' or `lei rediff -U100' to get more
context.

I hope to add support for rediff to the WWW UI once coderepo
integration is improved.

^ permalink raw reply	[relevance 7%]

* [PATCH 3/3] search: rectify comment (rt: documented since 738c4a65719e)
  @ 2023-10-16 11:33  6% ` Štěpán Němec
  2023-10-16 21:39  7%   ` Eric Wong
  0 siblings, 1 reply; 2+ results
From: Štěpán Němec @ 2023-10-16 11:33 UTC (permalink / raw)
  To: meta

Fixes: 738c4a65719e ("www: various help text updates")
---
On a related note, there's this comment in LeiXSearch.pm:312:

  # this should really be rt: (received-time), but no stable
  # public-inbox releases support it, yet.
  my $dt = 'dt:'.strftime('%Y%m%d%H%M%S', gmtime($lr)).'..';

So I went all "hey, it's been 3 releases with rt:, let's do this",
and suddenly, `lei up` stopped getting any updates :-]

The problem is that the date syntax handling for d:, dt: and rt: is not
the same (date_parse_prepare in Search.pm), which doesn't seem ideal to
me, either, but maybe that's intentional/necessary?

On a totally unrelated note, this patch is a nice example of how
--diff-algorithm=histogram (which I use by default) sometimes produces
diffs that are both longer and more confusing than with any other
(git-provided) algorithm:

 our $ENQ_ASCENDING = 1;
 our @MAIL_VMAP = (
        [ YYYYMMDD, 'd:'],
-       [ DT, 'dt:' ],
-       # these are undocumented for WWW, but lei and IMAP use them
-       [ BYTES, 'z:' ],
        [ TS, 'rt:' ],
+       # these are undocumented for WWW, but lei and IMAP use them
+       [ DT, 'dt:' ],
+       [ BYTES, 'z:' ],
        [ UID, 'uid:' ]
 );
 our @MAIL_NRP;

 lib/PublicInbox/Search.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index d7a6f9d7913c..477f77dcffeb 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -68,10 +68,10 @@ our $ENQ_DESCENDING = 0;
 our $ENQ_ASCENDING = 1;
 our @MAIL_VMAP = (
 	[ YYYYMMDD, 'd:'],
-	[ DT, 'dt:' ],
+	[ TS, 'rt:' ],
 	# these are undocumented for WWW, but lei and IMAP use them
+	[ DT, 'dt:' ],
 	[ BYTES, 'z:' ],
-	[ TS, 'rt:' ],
 	[ UID, 'uid:' ]
 );
 our @MAIL_NRP;
-- 
2.42.0


^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-10-16 11:33     [PATCH 1/3] doc: fix some typos and grammar Štěpán Němec
2023-10-16 11:33  6% ` [PATCH 3/3] search: rectify comment (rt: documented since 738c4a65719e) Štěpán Němec
2023-10-16 21:39  7%   ` 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).