git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-send-email: fix handling of special characters

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2013, 21:27 UTC
Message-ID
<7vtxltcrog.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130523211954.GD31421@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> writes:
Show 11 quoted lines
>> Is $author already sanitized at this point in the code?  I see it
>> was unwrapped with unquote_rfc2047 after it was read from the From:
>> line; will it always be the same as sanitize_address($author) would
>> return, and if not, would you rather compare between sanitized
>> versions of sender and author, no?
>
> Yes. I'll have to look at the code more closely.
> In my testing author here is "Michael S. Tsirkin" <mst@redhat.com>
> so it matches the sanitized sender.
> Of course that's because my name does not have non-ascii,
> just a dot.

So the conclusion is that the logic to see if the names are the same needs a bit more work than what was posted, I think?

Show 8 quoted lines
>> Also, isn't the $sender the same during the whole outer loop that
>> iterates over @files?  Do we need to apply sanitize_address() on it
>> over and over for each and every logical line in the @header?
>> 
>> This comment also applies to the other patch but they probably
>> should become a single patch anyway, I guess?
>
> OK so now you are ok with this last bit, right?
Sorry, but I am not sure what you are asking.

Do I think the assignment to $sanitized_sender can and should be done just once, not once per file, if the code inspection tells us that $sender is a constant inside the foreach (@files) loop?

Do I think these two are solving pretty much the same thing and is better to be done in a single patch?

I didn't really think them through when I responded, but now after you made me think, I would say the answers to both of them are yes.

Previous: Michael S. TsirkinNext: Michael S. Tsirkin
Message 5 of 6 in “git-send-email: fix handling of special characters”
  1. git-send-email: fix handling of special charactersMichael S. Tsirkin, May 23, 2013
  2. Junio C HamanoMay 23, 2013
  3. Junio C HamanoMay 23, 2013
  4. Michael S. TsirkinMay 23, 2013
  5. Junio C HamanoMay 23, 2013
  6. Michael S. TsirkinMay 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.