user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: saifi@strikr.io
Cc: meta@public-inbox.org
Subject: Re: convert mail content in git repo to mbox format
Date: Tue, 11 Jan 2022 21:41:03 -0500	[thread overview]
Message-ID: <87o84hbrr4.fsf@kyleam.com> (raw)
In-Reply-To: <d3bc1377-554b-3132-7a73-6a6e9b9e2c@strikr.io>

SAIFI writes:

> Now here is a very simple question (please don't tell me maildir,
> scripts dir etc etc, have spent 3+ hrs trawling through website and
> archives).
>
> I have read this discussion thread
> https://yhetil.org/meta/22947b1d-4728-30fa-ee96-fbd31496c0e6@gmx.at/T/#r8d12a02091311f1d8a7eae01dfaf873415d6b439
>
> I use alpine 2.24 and mbox format works great for me and for the 600GB
> mail archives without any problems till date. so 'mbox' it is for me.
>
> As an example, let's consider this mailing list archive.
>
> git clone --mirror http://lore.kernel.org/connman/0 connman/git/0.git
>
> Q: How do i convert the mail content trapped in the git repo to mbox format ?
>
> Is there a solution ? script ? Any pointers ?

Here's a slight variation of the recipe from the link you mentioned.
The main functional difference is that each message is converted to
mboxrd (via mblaze's mexport [1]):

  #!/bin/sh
  
  for commit in $(git -C connman/git/0.git rev-list master)
  do
      git -C connman/git/0.git cat-file blob $commit:m | mexport -
  done >mbox

If you want a one-time import, I think that could work okay, though it
wouldn't work well for augmenting an existing mbox.

Also, if a one-time import is what you're after (particularly with a
small inbox like connman), you could get by with the all.mbox.tar.gz
endpoint:

  $ curl -SfsL https://lore.kernel.org/connman/all.mbox.gz | \
    zcat >conman-mbox

For regular updates from <https://lore.kernel.org/connman>, you might be
interested in trying out lei (new in public-inbox 1.7.0).

  $ lei q -O https://lore.kernel.org/connman -o mboxrd:conman-lei-mbox \
    -a d:30.days.ago..
  # /usr/bin/curl -Sf -s -d '' https://lore.kernel.org/connman/?x=m&q=dt%3A20211213023449..
  # https://lore.kernel.org/connman/ 14/14
  # 14 written to conman-lei-mbox (14 matches)

  $ lei up conman-lei-mbox

[1] https://git.vuxu.org/mblaze/about/

  reply	other threads:[~2022-01-12  2:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 11:38 convert mail content in git repo to mbox format SAIFI
2022-01-12  2:41 ` Kyle Meyer [this message]
2022-01-12  8:16   ` SAIFI

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=87o84hbrr4.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=meta@public-inbox.org \
    --cc=saifi@strikr.io \
    /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.
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).