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
Address headers encoding #34
Address headers encoding #34
Conversation
Cool, thanks for the patches! I was looking into a fix for the encoding problem myself so I was able to give pretty detailed comments. If you fix the line-length problem then I will definitely accept patches 1 and 3. Regarding patch 2, I am willing to be convinced. Is patch 2 necessary for the other two patches? If not, please rebase it to the end of the patch series so that it doesn't hold the other two patches hostage. Please also sign off your patches in the Git style, as I have to sign them off when I submit the change to Git and I have to be more careful to do things by the book :-) |
Thanks for the thorough review, I'll update my branch. The second patch was "only needed" to be able to update the test data, I can certainly move it at the end. |
I think that I have taken care of all your comments. I left the "git log using user config" issue aside and just fixed the test suite to work in a clean environment (mimicking what t/test-env was already doing). |
RFC 2231 requires us to encode non-ascii characters but we must not encode the email part of email addresses, only the real name part. Do this properly now. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
This ensures that the code that encodes the real names works properly, both for a single address and multiple addresses. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
$HOME/.gitconfig or /etc/gitconfig could lead to differing behaviour of some commands used by git-multimail. In my case, it was "git log" that gained an implicit --decorate. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Here's another update taking care of your latest comments. |
I just merged and pushed your changes. Thanks! |
Some more thoughts about the "use plumbing" Vs "disable config" question: After thinking a bit more about it, I think it makes sense to run "git log" (not "git rev-list") to generate the body of messages and possibly to disable the user's configuration in this case. Using plumbing is the right thing when the output is meant for machine consumption. But in our case, the output of "git log" is not parsed, but only used to create a message that is meant to be read by the user. Using "git log" is what makes it simple to have multimailhook.logOpts, which accepts exactly what "git log" accepts. Arguably, git-multimail taking into account the repository's configuration (log.decorate) is a good thing. It's not a good idea to follow the user's log.decorate for a shared repository though. |
Your comments about using "git log" rather than "git rev-list" sound reasonable. ISTM that there are a few distinct ways of using git-multimail that we should try to keep in mind when considering configuration questions:
Maybe we should make it easier for the user to configure (via the hook script or within the repo configuration) which other Git configs should be read/ignored by git-multimail. This could currently be done by creating a mock HOME directory and setting it in the hook script via $HOME, and setting $GIT_CONFIG_NOSYSTEM to avoid reading /etc/gitconfig, but that's kindof cumbersome. |
Please merge this branch to fix issue #33 with invalid encoding of email addresses.