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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BF40D1F463 for ; Thu, 26 Sep 2019 20:52:25 +0000 (UTC) Received: by mail-qk1-x730.google.com with SMTP id u186so213929qkc.5 for ; Thu, 26 Sep 2019 13:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=95WPldfSu8/TJwTyJBerEPNKI3/p+Iy3GaPyZnJMB/M=; b=cSXuqWco10ifmugHvy+dDkEmusgkzMFVz7U5GzluWqsJsKkA1jxzf/7ZLWTCYm2+H0 c/2nF1FF9bqn4oczM3Lkuk9aXgrs00F6HXva/0tiE/TOFHNtM2Hv8ya3yROO6dvtWPm/ 8gpMjYAvqEpecDRjyp/veJlfmMrG/mReiF4Qs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=95WPldfSu8/TJwTyJBerEPNKI3/p+Iy3GaPyZnJMB/M=; b=r3cOmKE+FWuXaL5p93DWNEJKtBtc+G6vH2nRx02WJ19sa8TuTKFBFlRmzV8lNNfKCH 6cplOpYsGKsUxd/9gpm9nR6NM2hWBtWL1rjTi/ZxHMRJSFyC+qHO8FtvWWUCGWYIXBj0 o0adz3buyBIF2mOl2hZnB4DlVnYmwCeHaiZ8lqBq6/FXbKzh21a71mfcZELGMOExnWXV d0n1L84ONtR/y2RDsHO13UoG54g+CgYm/VJ/KOXaIIpn0qvNjbljKcAba0MN9kfXeNi6 OcmHr7fygAm7G15TETN8MUEmWFmlNgBqTwWyBh51ggTGqZM+b2AMMrjmkV1wZjV4tn1p FspQ== X-Gm-Message-State: APjAAAVQWu7/LxE5psXqLXfgmtL9EPxXBE9puj23CgqKXiqpXxL26bXj jpGX2xfVr6PctkHlaN4LLAO6+A== X-Google-Smtp-Source: APXvYqzebRUBxQn13Dt18HwFrsJPJuVlMgCGlGXMhv40rsETtTubmrmehd322iVbqwPZEHfZBY+Lpw== X-Received: by 2002:a37:61c9:: with SMTP id v192mr910663qkb.262.1569531144455; Thu, 26 Sep 2019 13:52:24 -0700 (PDT) Received: from chatter.i7.local (192-0-228-88.cpe.teksavvy.com. [192.0.228.88]) by smtp.gmail.com with ESMTPSA id h68sm191725qkd.35.2019.09.26.13.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 13:52:23 -0700 (PDT) Date: Thu, 26 Sep 2019 16:52:22 -0400 From: Konstantin Ryabitsev To: Eric Wong Cc: meta@public-inbox.org Subject: Re: Git-only operation mode Message-ID: <20190926205222.GC10467@chatter.i7.local> References: <20190925182431.GA4628@chatter.i7.local> <20190925194503.GA21501@dcvr> <20190925195838.GB4628@chatter.i7.local> <20190925224500.GA28628@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20190925224500.GA28628@dcvr> User-Agent: Mutt/1.12.1 (2019-06-15) List-Id: 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