user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Eric Wong <e@80x24.org>
Cc: meta@public-inbox.org
Subject: Re: Git-only operation mode
Date: Thu, 26 Sep 2019 16:52:22 -0400	[thread overview]
Message-ID: <20190926205222.GC10467@chatter.i7.local> (raw)
In-Reply-To: <20190925224500.GA28628@dcvr>

On Wed, Sep 25, 2019 at 10:45:00PM +0000, Eric Wong wrote:
>> A follow-up to that -- is running "public-inbox-index" on the 
>> repository
>> after it's been updated enough to update the xapian db? It would be easy to
>> do so as part of the grok-pull post-update hook.
>
>Yes, on a fresh clone.  You'll need to change indexlevel to
>medium or full if it was setup using basic.
>
>I haven't figured out how to use a grok-pull post-update hook to
>run index on my clone of erol, since there's multiple epochs
>per-inbox to deal with.

Theoretically, shouldn't be that difficult. The post-update hook fires 
on clone/update with the full path to the repo that got updated, e.g.

post-update-hook.sh /var/lib/public-inbox/lkml/git/7.git

Here's a quick and dirty start to the post-update-hook that I came up 
with:

-----
#!/bin/bash

topdir=$(echo $1 | sed 's|/git/[[:digit:]]*\.git$||g')
pidir=$(basename $topdir)
url="http://localhost:8080/${pidir}"

cd $topdir/..

if [[ ! -f $pidir/msgmap.sqlite3 ]]; then
    listid=$(git --git-dir=$1 show master:m | grep -i '^List-Id:' | sed 's|.*:.*<\(.*\)>$|\1|g')
    email=$(echo $listid | sed 's|\.|@|')
    public-inbox-init -V2 $pidir $pidir/ $url $email
    # Need logic here for adding to the config file
fi

public-inbox-index $pidir
-----

It needs some kind of a template entry for adding to the config file 
post-init, but this should at least do the right thing for running 
public-inbox-index on repo updates.

-K

  parent reply	other threads:[~2019-09-26 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 18:24 Git-only operation mode Konstantin Ryabitsev
2019-09-25 19:45 ` Eric Wong
2019-09-25 19:58   ` Konstantin Ryabitsev
2019-09-25 22:45     ` Eric Wong
2019-09-26  0:23       ` Eric W. Biederman
2019-09-26 20:52       ` Konstantin Ryabitsev [this message]
2019-09-26 21:10         ` Eric Wong
2019-09-26 21:44           ` Konstantin Ryabitsev
2019-10-07  0:07         ` 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: http://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=20190926205222.GC10467@chatter.i7.local \
    --to=konstantin@linuxfoundation.org \
    --cc=e@80x24.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.
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).