All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: tools@linux.kernel.org, stable@vger.kernel.org, meta@public-inbox.org
Cc: sashal@kernel.org, gregkh@linuxfoundation.org, mricon@kernel.org,
	krzk@kernel.org
Subject: filtering stable patches in lore queries
Date: Sat, 27 Apr 2024 02:28:55 +0200	[thread overview]
Message-ID: <ZixGx_sTyDmdUlaV@zx2c4.com> (raw)

Hi,

Greg and Sasha add the "X-stable: review" to their patch bombs, with the
intention that people will be able to filter these out should they
desire to do so. For example, I usually want all threads that match code
I care about, but I don't regularly want to see thousand-patch stable
series. So this header is helpful.

However, I'm not able to formulate a query for lore (to pass to `lei q`)
that will match on negating it. The idea would be to exclude the thread
if the parent has this header. It looks like public inbox might only
index on some headers, but can't generically search all? I'm not sure
how it works, but queries only seem to half way work when searching for
that header.

In the meantime, I've been using this ugly bash script, which gets the
job done, but means I have to download everything locally first:

    #!/bin/bash
    PWD="${BASH_SOURCE[0]}"
    PWD="${PWD%/*}"
    set -e
    cd "$PWD"
    echo "[+] Syncing new mail" >&2
    lei up "$PWD"
    echo "[+] Cleaning up stable patch bombs" >&2
    mapfile -d $'\0' -t parents < <(grep -F -x -Z -r -l 'X-stable: review' cur tmp new)
    {
      [[ -f stable-message-ids ]] && cat stable-message-ids
      [[ ${#parents[@]} -gt 0 ]] && sed -n 's/^Message-ID: <\(.*\)>$/\1/p' "${parents[@]}"
    } | sort -u > stable-message-ids.new
    mv stable-message-ids.new stable-message-ids
    [[ -s stable-message-ids ]] || exit 0
    mapfile -d $'\0' -t children < <(grep -F -Z -r -l -f - cur tmp new < stable-message-ids)
    total=$(( ${#parents[@]} + ${#children[@]} ))
    [[ $total -gt 0 ]] || exit 0
    echo "# rm <...$total messages...>" >&2
    rm -f "${parents[@]}" "${children[@]}"

This results in something like:

    zx2c4@thinkpad ~/Projects/lkml $ ./update.bash
    [+] Syncing new mail
    # https://lore.kernel.org/all/ limiting ...
    # /usr/bin/curl -gSf -s -d '' https://lore.kernel.org/all/?x=m&t=1&q=(...
    [+] Cleaning up stable patch bombs
    # rm <...24593 messages...>

It works, but it'd be nice to not even download these messages in the
first place. Since I'm deleting message I don't want, I have to keep
track of the message IDs of those deleted messages with the stable
header in case replies come in later. That's some book keeping, sheesh!

Any thoughts on this workflow?

Jason

             reply	other threads:[~2024-04-27  0:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  0:28 Jason A. Donenfeld [this message]
2024-04-27  7:19 ` filtering stable patches in lore queries Eric Wong
2024-04-29 14:27   ` Konstantin Ryabitsev
2024-05-08 11:33     ` Eric Wong
2024-05-08 17:01       ` Konstantin Ryabitsev
2024-05-08 17:09         ` 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

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

  git send-email \
    --in-reply-to=ZixGx_sTyDmdUlaV@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=meta@public-inbox.org \
    --cc=mricon@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tools@linux.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.