From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3A2E21F463; Thu, 26 Sep 2019 21:10:25 +0000 (UTC) Date: Thu, 26 Sep 2019 21:10:25 +0000 From: Eric Wong To: Konstantin Ryabitsev Cc: meta@public-inbox.org Subject: Re: Git-only operation mode Message-ID: <20190926211025.GA11146@dcvr> References: <20190925182431.GA4628@chatter.i7.local> <20190925194503.GA21501@dcvr> <20190925195838.GB4628@chatter.i7.local> <20190925224500.GA28628@dcvr> <20190926205222.GC10467@chatter.i7.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190926205222.GC10467@chatter.i7.local> List-Id: Konstantin Ryabitsev wrote: > 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 If grok-pull is using multiple threads, there can be a race there because parallel runs of public-inbox-init can clobber each other (which needs to be fixed :x) > # Need logic here for adding to the config file Yeah, I've been meaning to add something like "$INBOX_URL/_/text/config" so some of the config keys can be easily cloned, too. Not sure if it's something that can be stuffed in manifest.js.gz or better as a separate file... Probably separate 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