unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* RFC: normalize whitespace in lei queries
@ 2021-09-10 14:11 Konstantin Ryabitsev
  2021-09-11  0:19 ` [PATCH 0/3] lei saved-search fixes Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Konstantin Ryabitsev @ 2021-09-10 14:11 UTC (permalink / raw)
  To: meta

Just a quickie note. I was trying to make my query more readable, so I
switched my test example to the following:

[lei]
    q = (dfn:Documentation/security/landlock.rst \
         OR dfn:Documentation/userspace-api/landlock.rst \
         OR dfn:include/uapi/linux/landlock.h \
         OR dfn:samples/landlock/ \
         OR dfn:security/landlock/ \
         OR dfn:tools/testing/selftests/landlock/ \
         OR dfhh:landlock OR dfctx:landlock) \
        AND rt:2.months.ago..

However, I noticed that curl queries ended up gaining a lot of ++++:

# /usr/bin/curl -Sf -s -d '' https://lore.kernel.org/all/?q=(dfn%3ADocumentation%2Fsecurity%2Flandlock.rst++++++++++OR+dfn%3ADocumentation%2Fuserspace-api%2Flandlock.rst++++++++++OR+dfn%3Ainclude%2Fuapi%2Flinux%2Flandlock.h++++++++++OR+dfn%3Asamples%2Flandlock%2F++++++++++OR+dfn%3Asecurity%2Flandlock%2F++++++++++OR+dfn%3Atools%2Ftesting%2Fselftests%2Flandlock%2F++++++++++OR+dfhh%3Alandlock+OR+dfctx%3Alandlock)+++++++++AND+rt%3A1625943784..&x=m&t=1

I think it's reasonable to normalize \s+ into a single space for all queries,
right?

Another observation is that when I missed a \ on one of the lines, I managed
to make lei unusable. :)

$ lei up --all
failed to close (git config -z -l --includes --file=/home/user/.cache/lei/saved-tmp.1581950.1631282889.config) pipe: 32768 at /usr/local/share/perl/5.32.1/PublicInbox/Config.pm line 172.

$ lei edit-search ~/work/temp/lei/landlock
failed to close (git config -z -l --includes --file=/home/user/.local/share/lei/saved-searches/landlock-1804cfad691a409f55598a8528566d5f1539b2632e1db7e206cb147396582631/lei.saved-search) pipe: 32768 at /usr/local/share/perl/5.32.1/PublicInbox/Config.pm line 172.

I fixed it by manually editing lei.saved-search and adding the missing
backslash. Not sure what the proper solution for this is -- perhaps attempting
to parse the edited config file and refusing to save it if it doesn't work?

-K

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

end of thread, other threads:[~2021-09-11  0:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-10 14:11 RFC: normalize whitespace in lei queries Konstantin Ryabitsev
2021-09-11  0:19 ` [PATCH 0/3] lei saved-search fixes Eric Wong
2021-09-11  0:19   ` [PATCH 1/3] lei: fix handling of broken lei.saved-search config files Eric Wong
2021-09-11  0:19   ` [PATCH 2/3] lei: pass client stderr to git-config in more places Eric Wong
2021-09-11  0:19   ` [PATCH 3/3] lei: normalize whitespace in remote queries 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).