Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to use committer as "From" in generated mails #31

Closed
rhertzog opened this issue Jul 28, 2013 · 6 comments
Closed

Possibility to use committer as "From" in generated mails #31

rhertzog opened this issue Jul 28, 2013 · 6 comments

Comments

@rhertzog
Copy link
Contributor

We have a limited set of committers and we like to see who commited directly in the "From" field. Please make it possible to use that identity in the From field ideally with a simple setting, otherwise at least with wrapper script.

Right now, it's not possible to override get_fromaddr() of the Environment because it doesn't get the details of the commit or from the changes.

@mhagger
Copy link
Contributor

mhagger commented Jul 31, 2013

Does the "computed-from" branch that I just pushed do what you need? It changes the callers of get_fromaddr() to pass a Change instance to the method when one is available. You could override Environment.get_fromaddr() with code like

if isinstance(change, Revision):
    ....
elif isinstance(change, ReferenceChange):
    ....
else:
    # change can be None, too, if called when instantiating an SMTPMailer if environment.get_sender() does
    # not return a value; in that case you have to return something here, too.

@rhertzog
Copy link
Contributor Author

Yes, looks like so. It would be even easier if Revision extracted the committer information too at the same time it takes care of the author.

@catalin-hritcu
Copy link

I'm a git and git-multimail noob, and just noticed that some commit messages were marked as spam because of the completely made up FROM address. I would like to use the committer's address in FROM. How can I do that?

@catalin-hritcu
Copy link

Never mind. I've found a hacky way of doing this by passing the user email in as an environment variable that is assigned the result of

$(git log -1 --format=format:%ae HEAD)

and then overriding get_fromaddr to use this. It's not nice, but it works.

@moy
Copy link
Contributor

moy commented Jun 19, 2015

Fixed by #99.

@moy moy closed this as completed Jun 19, 2015
@catalin-hritcu
Copy link

This works great, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants