Re: commit -> public-inbox link helper
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 4, 2018, 20:59 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1804042257040.55@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
- In-Reply-To
- <20180404183620.GC9055@sigill.intra.peff.net>
Hi Peff,
On Wed, 4 Apr 2018, Jeff King wrote:
Show 28 quoted lines
> On Wed, Apr 04, 2018 at 06:35:59PM +0200, Johannes Schindelin wrote: > > > I found myself in dear need to quickly look up mails in the public-inbox > > mail archive corresponding to any given commit in git.git. Some time ago, > > I wrote a shell script to help me with that, and I found myself using it a > > couple of times, so I think it might be useful for others, too. > > > > This script (I call it lookup-commit.sh) needs to be dropped into a *bare* > > clone of http://public-inbox.org/git, and called with its absolute or > > relative path from a git.git worktree, e.g. > > > > ~/public-inbox-git.git/lookup-commit.sh \ > > fea16b47b603e7e4fa7fca198bd49229c0e5da3d > > > > This will take a while initially, or when the `master` branch of the > > public-inbox mirror was updated, as it will generate two files with > > plain-text mappings. > > Junio publishes a git-notes ref with the mapping you want. So you can > do: > > git fetch git://github.com/gitster/git.git refs/notes/amlog:refs/notes/amlog > mid=$(git notes --ref amlog show $commit | perl -lne '/<(.*)>/ and print $1') > echo "https://public-inbox.org/git/$mid" > > without having to download the gigantic list archive repo at all (though > I do keep my own copy of the archive and index it with mairix, so I can > use "mairix -t m:$mid" and then view the whole thing locally in mutt).
Good to know! Thanks for the script.
And thanks also for the `--ref` trick: I had a look at the man page of git-notes, and it was not immediately obvious that it supports options before the sub-subcommand. The `--ref` description is buried pretty deep in there.
Thanks, Dscho