Re: email as a bona fide git transport

From: Theodore Y. Ts'o
Date: Fri Oct 18 2019 - 15:15:35 EST


On Fri, Oct 18, 2019 at 06:50:51PM +0200, Vegard Nossum wrote:
> I started out using this approach, but I changed it because the
> implementation was a bit annoying: 'git am' runs 'git mailsplit',
> which just splits the email into two parts:
>
> 1) headers, changelog, and diffstat;
> 2) diff and signature.
>
> One of my PoC patches changes mailsplit to split the extra metadata into
> a third file.
>
> The problem I ran into with putting the metadata at the end was
> detecting where the diff ends. A comment in 'git apply' suggested that
> detecting the difference between "--" as a diff/signature separator and
> as part of the diff is nontrivial in the sense that you need to actually
> do some parsing and keep track of hunk sizes.

Could we cheat by having "git format-patch" add a "Diff-size" in the
header which gives the number of lines in the diff so git am can just
count lines to find the Trailer section?

Thanks,

- Ted