unofficial mirror of
 help / color / mirror / Atom feed
* lei q: importing messages when specifying '-f *json*'?
@ 2021-12-30 23:04 Kyle Meyer
  0 siblings, 0 replies; only message in thread
From: Kyle Meyer @ 2021-12-30 23:04 UTC (permalink / raw)
  To: meta; +Cc: piem

The lei-q interface I'm working on for piem [1] consumes JSON output to
display search results.  From there, an individual message can be shown.
If the query is against a remote external, that involves two curl calls
to the remote, one for the search and one for the display.

I'd like to import hits from the first step into the local store so that
I can avoid the second curl call.  However, I haven't been able to
figure out a way to do this when requesting JSON output.

For example [2], say I don't have meta's

  $ lei daemon-kill
  $ export HOME=$(mktemp -d "${TMPDIR:-/tmp}"/pi-testing-XXXXXXX)
  $ lei q
  # /tmp/pi-testing-3JaSz2K/.config/lei/config created

If I search for that message against and
request JSON output

  $ lei q -I -f ldjson \
  # /usr/bin/curl -Sf -s -d ''

then no message ends up in the local store:

  $ lei q

In contrast, if I request mboxrd output

  $ lei q -I -f mboxrd \ >/dev/null
  # /usr/bin/curl -Sf -s -d ''

the message is imported to the local store:

  $ lei q -f ldjson
  $ git -C $HOME/.local/share/lei/store/local/0.git/ log --oneline
  ca12a1b (HEAD -> master) [PATCH] eliminate some unused subs

I was hoping that --import-remote might do the trick, but that doesn't
seem to be the case:

  $ lei daemon-kill
  $ export HOME=$(mktemp -d "${TMPDIR:-/tmp}"/pi-testing-XXXXXXX)
  $ lei q --import-remote -I \
    -f ldjson
  # /tmp/pi-testing-Ny7KDcB/.config/lei/config created
  # /usr/bin/curl -Sf -s -d ''
  $ lei q

Should --import-remote trigger an import in the case above?

[2] These are with public-inbox's current master (07cd8973baf).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-30 23:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30 23:04 lei q: importing messages when specifying '-f *json*'? Kyle Meyer

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).