Re: RFC: hooks in public-inbox-watch

2022-05-12 Thread Konstantin Ryabitsev
On Thu, May 12, 2022 at 07:38:59PM +, Eric Wong wrote:
> Konstantin Ryabitsev  wrote:
> > Hi, all:
> > 
> > What do you think about a mechanism to run hooks at the stage right before
> > public-inbox-watch adds a new message to the archive? One feature that would
> > be neat is to search archives for all instances of the same patch using its
> > $(git-patch-id --stable) and adding a header, e.g.:
> > 
> > X-Git-Patch-ID: 19c05284cea20b72b44c2b7e6cfd782a6a860cf1 
> > 
> 
> There shouldn't be any need for a header.  I've been meaning to
> teach -index to use git-patch-id and index it's output, anyways.
> That would work for old messages, too.

Sure, I'll take that, too. :)

Thanks,
-K



Re: RFC: hooks in public-inbox-watch

2022-05-12 Thread Eric Wong
Konstantin Ryabitsev  wrote:
> Hi, all:
> 
> What do you think about a mechanism to run hooks at the stage right before
> public-inbox-watch adds a new message to the archive? One feature that would
> be neat is to search archives for all instances of the same patch using its
> $(git-patch-id --stable) and adding a header, e.g.:
> 
> X-Git-Patch-ID: 19c05284cea20b72b44c2b7e6cfd782a6a860cf1 
> 

There shouldn't be any need for a header.  I've been meaning to
teach -index to use git-patch-id and index it's output, anyways.
That would work for old messages, too.

> I know this can be done at the postfix stage, but seems like it would be more
> efficient at the ingestion stage.
> 
> Maybe even instead of a hook this could be a native public-inbox feature, with
> this header being indexed by default?

I've always tried as hard as possible to avoid adding new
headers or extra data; especially when we have a common and
stable tool to generate it.  Another danger is a malicious
client could also be introducing wrong ones to confuse searches.

Thanks.



RFC: hooks in public-inbox-watch

2022-05-12 Thread Konstantin Ryabitsev
Hi, all:

What do you think about a mechanism to run hooks at the stage right before
public-inbox-watch adds a new message to the archive? One feature that would
be neat is to search archives for all instances of the same patch using its
$(git-patch-id --stable) and adding a header, e.g.:

X-Git-Patch-ID: 19c05284cea20b72b44c2b7e6cfd782a6a860cf1 


I know this can be done at the postfix stage, but seems like it would be more
efficient at the ingestion stage.

Maybe even instead of a hook this could be a native public-inbox feature, with
this header being indexed by default?

-K