<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t5100, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=master</id>
<link rel='self' href='https://git.shady.money/git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-12-27T22:52:26Z</updated>
<entry>
<title>Merge branch 'jk/mailinfo-iterative-unquote-comment'</title>
<updated>2023-12-27T22:52:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-12-27T22:52:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9df9e3770a15b47e48f8218eed6d68ebcb5eed6c'/>
<id>urn:sha1:9df9e3770a15b47e48f8218eed6d68ebcb5eed6c</id>
<content type='text'>
The code to parse the From e-mail header has been updated to avoid
recursion.

* jk/mailinfo-iterative-unquote-comment:
  mailinfo: avoid recursion when unquoting From headers
  t5100: make rfc822 comment test more careful
</content>
</entry>
<entry>
<title>t5100: make rfc822 comment test more careful</title>
<updated>2023-12-14T22:33:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-12-14T21:47:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d9396c2feac8b707b367c64cd59604d7bc86a33'/>
<id>urn:sha1:2d9396c2feac8b707b367c64cd59604d7bc86a33</id>
<content type='text'>
When processing "From" headers in an email, mailinfo "unquotes" quoted
strings and rfc822 parenthesized comments. For quoted strings, we
actually remove the double-quotes, so:

  From: "A U Thor" &lt;someone@example.com&gt;

become:

  Author: A U Thor
  Email: someone@example.com

But for comments, we leave the outer parentheses in place, so:

  From: A U (this is a comment) Thor &lt;someone@example.com&gt;

becomes:

  Author: A U (this is a comment) Thor
  Email: someone@example.com

So what is the comment "unquoting" actually doing? In our code, being in
a comment section has exactly two effects:

  1. We'll unquote backslash-escaped characters inside a comment
     section.

  2. We _won't_ unquote double-quoted strings inside a comment section.

Our test for comments in t5100 checks this:

  From: "A U Thor" &lt;somebody@example.com&gt; (this is \(really\) a comment (honestly))

So it is covering (1), but not (2). Let's add in a quoted string to
cover this.

Moreover, because the comment appears at the end of the From header,
there's nothing to confirm that we correctly found the end of the
comment section (and not just the end-of-string). Let's instead move it
to the beginning of the header, which means we can confirm that the
existing quoted string is detected (which will only happen if we know
we've left the comment block).

As expected, the test continues to pass, but this will give us more
confidence as we refactor the code in the next patch.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>e-mail workflow: Message-ID is spelled with ID in both capital letters</title>
<updated>2023-04-03T15:55:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-16T01:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba4324c4e1e32a28381ea1f4835b78e4c9d45575'/>
<id>urn:sha1:ba4324c4e1e32a28381ea1f4835b78e4c9d45575</id>
<content type='text'>
We used to write "Message-Id:" and "Message-ID:" pretty much
interchangeably, and the header name is defined to be case
insensitive by the RFCs, but the canonical form "Message-ID:" is
used throughout the RFC documents, so let's imitate it ourselves.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
</content>
</entry>
<entry>
<title>mailinfo: warn if CRLF found in decoded base64/QP email</title>
<updated>2021-05-10T06:06:22Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2021-05-09T17:12:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b689562cafc05b1a36bdea3d025c9ecdf2514bd'/>
<id>urn:sha1:0b689562cafc05b1a36bdea3d025c9ecdf2514bd</id>
<content type='text'>
When SMTP servers receive 8-bit email messages, possibly with only
LF as line ending, some of them decide to change said LF to CRLF.

Some mailing list softwares, when receive 8-bit email messages,
decide to encode those messages in base64 or quoted-printable.

If an email is transfered through above mail servers, then distributed
by such mailing list softwares, the recipients will receive an email
contains a patch mungled with CRLF encoded inside another encoding.

Thus, such CR (in CRLF) couldn't be dropped by "mailsplit".
Hence, the mailed patch couldn't be applied cleanly.
Such accidents have been observed in the wild [1].

Instead of silently rejecting those messages, let's give our users
some warnings if such CR (as part of CRLF) is found.

[1]: https://nmbug.notmuchmail.org/nmweb/show/m2lf9ejegj.fsf%40guru.guru-group.fi

Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kd/mailinfo-quoted-string'</title>
<updated>2016-10-03T20:30:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-03T20:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe252ef81a6ff96b3ed11e98feb96784d35f15f8'/>
<id>urn:sha1:fe252ef81a6ff96b3ed11e98feb96784d35f15f8</id>
<content type='text'>
An author name, that spelled a backslash-quoted double quote in the
human readable part "My \"double quoted\" name", was not unquoted
correctly while applying a patch from a piece of e-mail.

* kd/mailinfo-quoted-string:
  mailinfo: unescape quoted-pair in header fields
  t5100-mailinfo: replace common path prefix with variable
</content>
</entry>
<entry>
<title>mailinfo: unescape quoted-pair in header fields</title>
<updated>2016-09-28T20:21:18Z</updated>
<author>
<name>Kevin Daudt</name>
<email>me@ikke.info</email>
</author>
<published>2016-09-28T19:52:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f357e5de31595c28a303aaf5443c26f492441a6f'/>
<id>urn:sha1:f357e5de31595c28a303aaf5443c26f492441a6f</id>
<content type='text'>
rfc2822 has provisions for quoted strings in structured header fields,
but also allows for escaping these with so-called quoted-pairs.

The only thing git currently does is removing exterior quotes, but
quotes within are left alone.

Remove exterior quotes and remove escape characters so that they don't
show up in the author field.

Signed-off-by: Kevin Daudt &lt;me@ikke.info&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailinfo: handle in-body header continuations</title>
<updated>2016-09-21T17:23:11Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-09-20T17:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b4b013f1884a3b5e67877d65a9f1da598ab4a6f'/>
<id>urn:sha1:6b4b013f1884a3b5e67877d65a9f1da598ab4a6f</id>
<content type='text'>
Mailinfo currently handles multi-line headers, but it does not handle
multi-line in-body headers. Teach it to handle such headers, for
example, for this input:

  From: author &lt;author@example.com&gt;
  Date: Fri, 9 Jun 2006 00:44:16 -0700
  Subject: a very long
   broken line

  Subject: another very long
   broken line

interpret the in-body subject to be "another very long broken line"
instead of "another very long".

An existing test (t/t5100/msg0015) has an indented line immediately
after an in-body header - it has been modified to reflect the new
functionality.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailsplit: support unescaping mboxrd messages</title>
<updated>2016-06-06T18:14:43Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2016-06-05T04:46:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c88098d7f19c6322fbd911bb89e2efd246bf75c4'/>
<id>urn:sha1:c88098d7f19c6322fbd911bb89e2efd246bf75c4</id>
<content type='text'>
This will allow us to parse the output of --pretty=mboxrd
and the output of other mboxrd generators.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-mailinfo: add --message-id</title>
<updated>2014-11-25T23:24:55Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2014-11-25T14:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=452dfbed1a80754bfdc52567d9d9dba08a7d0a6d'/>
<id>urn:sha1:452dfbed1a80754bfdc52567d9d9dba08a7d0a6d</id>
<content type='text'>
This option adds the content of the Message-Id header at the end of the
commit message prepared by git-mailinfo.  This is useful in order to
associate commit messages automatically with mailing list discussions.

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailinfo: make "&gt;From" in-body header check more robust</title>
<updated>2014-09-16T18:05:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-09-14T01:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2da1f36671c3e3e28eba6a56d92249b6671c07d3'/>
<id>urn:sha1:2da1f36671c3e3e28eba6a56d92249b6671c07d3</id>
<content type='text'>
Since commit 81c5cf7 (mailinfo: skip bogus UNIX From line inside
body, 2006-05-21), we have treated lines like "&gt;From" in the body as
headers. This makes "git am" work for people who erroneously paste
the whole output from format-patch:

  From 12345abcd...fedcba543210 Mon Sep 17 00:00:00 2001
  From: them
  Subject: [PATCH] whatever

into their email body (assuming that an mbox writer then quotes
"From" as "&gt;From", as otherwise we would actually mailsplit on the
in-body line).

However, this has false positives if somebody actually has a commit
body that starts with "From "; in this case we erroneously remove
the line entirely from the commit message. We can make this check
more robust by making sure the line actually looks like a real mbox
"From" line.

Inspect the line that begins with "&gt;From " a more carefully to only
skip lines that match the expected pattern (note that the datestamp
part of the format-patch output is designed to be kept constant to
help those who write magic(5) entries).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
