I think the real solution to this should come from Github if we can
convince them that it's worth their time to have a separate notification
category for these things. One short-term solution for this might be to
modify the commit messages that automerge uses. The simplest version of
this would be something like injecting a zero-width space after every @
that is followed by something that could plausibly be a GH username,
e.g. `re.sub("@(?=[a-zA-Z0-9])", "@\u200b", commit_message)`. It would
read the same way but I think wouldn't trigger a mention.

We could presumably also make this a bit more targeted by actually
trying to extract the mentioned user and checking if it's an actual GH
user, and inject the ZWS only then.

We could also use something other than a ZWS. A ZWS is nice because it
won't visually mangle the commit message at all, but it's bad because if
someone copy-pastes something from the commit message they probably
won't know that they have invisible formatting characters in it, and
that might be immensely frustrating. "Only inject a ZWS in the event
that it's a real user" won't necessarily help if people are including
code snippets containing @classmethod <https://github.com/classmethod>
in them.

Best,
Paul

P.S. If anyone with communications channels to Github is planning to
lobby for changes, I'd prefer a way to say, "Never notify me of @
messages in commit messages" followed by a special CC: address for easy
filtering, followed by "Please don't notify me a second time when an
identical commit shows up in a fork of a project I've already been
notified for" (though all three of these would be good improvements with
or without the others).

On 4/6/21 11:52 AM, Zachary Ware wrote:
> On Tue, Apr 6, 2021 at 9:36 AM Victor Stinner <vstin...@python.org> wrote:
>> I'm getting more and more email notifications when a commit contains
>> my GitHub handle ("@vstinner"). For example: "Automerge-Triggered-By:
>> @vstinner".
> Yes, this is a pretty substantial failing of GitHub for popular projects :(
>
>> But the problem is that the "automerge" labels uses
>> "Automerge-Triggered-By: @vstinner" syntax. Maybe a small enhancement
>> would be to use ""Automerge-Triggered-By: vstinner" syntax instead
>> (avoid the @).
> This is already done; see
> https://github.com/python/miss-islington/commit/334c817cecf6c5c7f074ec7dbbad89d491b42f1a
> (we now use `GH:vstinner` to keep it clear that it's a GitHub handle
> without triggering GitHub's automatic linking/mentioning).
>
>> Some developers put my handle in a commit message since it becomes the
>> PR descriptor and sends ping me by email. But then my handle lands
>> into the merged commit message, like:
>> ...
>> I'm not asking you to stop mentioning me. I'm just asking for help how
>> to filter these notifications?
> This is one of the several reasons that I don't like using the PR
> description as the commit message when using auto-merge :).  I still
> think we ought to require a new comment with a special marker to
> contain the commit message.  I haven't found time or motivation to
> actually try to make this change, though.
>
> That change wouldn't help with existing messy commits, though, and
> those keep popping up when someone does something weird with their
> fork, like rebasing one stable branch on another.  I'm afraid I don't
> have a good solution for that that doesn't risk masking the messages
> you might actually want to see :(
> _______________________________________________
> python-committers mailing list -- python-committers@python.org
> To unsubscribe send an email to python-committers-le...@python.org
> https://mail.python.org/mailman3/lists/python-committers.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-committers@python.org/message/WDPQ5I6NBT6IRDKA4WQPVEWHQIUTPHJ7/
> Code of Conduct: https://www.python.org/psf/codeofconduct/
_______________________________________________
python-committers mailing list -- python-committers@python.org
To unsubscribe send an email to python-committers-le...@python.org
https://mail.python.org/mailman3/lists/python-committers.python.org/
Message archived at 
https://mail.python.org/archives/list/python-committers@python.org/message/VCMZ52M74XV46CWOSQ4NH5MFQAZW722W/
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to