]> git.ipfire.org Git - thirdparty/git.git/commit - log-tree.c
format-patch: Produce better output with --inline or --attach
authorKevin Ballard <kevin@sb.org>
Wed, 30 Jul 2008 05:49:33 +0000 (22:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Jul 2008 06:18:15 +0000 (23:18 -0700)
commit6b2fbaaffc5ec762eae5d23b58b1dc0a88e2275e
treec74662decbfde7365c0f7e449458dfa4d5598c0c
parent8cb070a4cfea48f88ada02a87320c3ca63b934cb
format-patch: Produce better output with --inline or --attach

This patch makes two small changes to improve the output of --inline
and --attach.

The first is to write a newline preceding the boundary. This is needed because
MIME defines the encapsulation boundary as including the preceding CRLF (or in
this case, just LF), so we should be writing one. Without this, the last
newline in the pre-diff content is consumed instead.

The second change is to always write the line termination character
(default: newline) even when using --inline or --attach. This is simply to
improve the aesthetics of the resulting message. When using --inline an email
client should render the resulting message identically to the non-inline
version. And when using --attach this adds a blank line preceding the
attachment in the email, which is visually attractive.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
log-tree.c
t/t4013/diff.format-patch_--attach_--stdout_initial..master
t/t4013/diff.format-patch_--attach_--stdout_initial..master^
t/t4013/diff.format-patch_--attach_--stdout_initial..side
t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master
t/t4013/diff.format-patch_--inline_--stdout_initial..master
t/t4013/diff.format-patch_--inline_--stdout_initial..master^
t/t4013/diff.format-patch_--inline_--stdout_initial..master^^
t/t4013/diff.format-patch_--inline_--stdout_initial..side