unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: meta@public-inbox.org
Subject: RFC: normalize whitespace in lei queries
Date: Fri, 10 Sep 2021 10:11:57 -0400	[thread overview]
Message-ID: <20210910141157.6u5adehpx7wftkor@meerkat.local> (raw)

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

             reply	other threads:[~2021-09-10 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 14:11 Konstantin Ryabitsev [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910141157.6u5adehpx7wftkor@meerkat.local \
    --to=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).