{"thread":{"id":"39641","subject":"[PATCH/RFC] Revert \"git am/mailinfo: Don't look at in-body headers when rebasing\"","startedAt":"2015-06-16T09:03:12Z","lastAt":"2015-06-24T16:04:24Z","messageCount":4,"participants":["Paul Tan","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"263917","messageId":"1434445392-6265-1-git-send-email-pyokagan@gmail.com","threadId":"39641","inReplyTo":null,"subject":"[PATCH/RFC] Revert \"git am/mailinfo: Don't look at in-body headers when rebasing\"","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-06-16T09:03:12Z","receivedAt":"2015-06-16T09:03:12Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"This reverts commit d25e51596be9271ad833805a3d6f9012dc24ee79, removing\ngit-mailsplit's --no-inbody-headers option.\n\nWhile --no-inbody-headers was introduced to prevent commit messages from\nbeing munged by git-mailinfo while rebasing, the need for this option\ndisappeared since 5e835ca (rebase: do not munge commit log message,\n2008-04-16), as git-am bypasses git-mailinfo and gets the commit message\ndirectly from the commit ID in the patch.\n\ngit-am is the only user of --no-inbody-headers, and this option is not\ndocumented. As such, it should be removed.\n\nSigned-off-by: Paul Tan <pyokagan@gmail.com>\n---\n\nNotes:\n    The other direction, of course, is to turn --no-inbody-headers into a\n    supported, documented option in both git-mailsplit and git-am.\n    \n    I do also wonder if we should just ensure that git-format-patch does not\n    generate a message that start with \"From\" or \"Date\".\n\n builtin/mailinfo.c                   | 12 +-----------\n git-am.sh                            |  9 +--------\n t/t5100-mailinfo.sh                  |  4 ----\n t/t5100/info0015--no-inbody-headers  |  5 -----\n t/t5100/info0016--no-inbody-headers  |  5 -----\n t/t5100/msg0015--no-inbody-headers   |  3 ---\n t/t5100/msg0016--no-inbody-headers   |  4 ----\n t/t5100/patch0015--no-inbody-headers |  8 --------\n t/t5100/patch0016--no-inbody-headers |  8 --------\n 9 files changed, 2 insertions(+), 56 deletions(-)\n delete mode 100644 t/t5100/info0015--no-inbody-headers\n delete mode 100644 t/t5100/info0016--no-inbody-headers\n delete mode 100644 t/t5100/msg0015--no-inbody-headers\n delete mode 100644 t/t5100/msg0016--no-inbody-headers\n delete mode 100644 t/t5100/patch0015--no-inbody-headers\n delete mode 100644 t/t5100/patch0016--no-inbody-headers\n\ndiff --git a/builtin/mailinfo.c b/builtin/mailinfo.c\nindex 999a525..34ea160 100644\n--- a/builtin/mailinfo.c\n+++ b/builtin/mailinfo.c\n@@ -26,7 +26,6 @@ static int patch_lines;\n static struct strbuf **p_hdr_data, **s_hdr_data;\n static int use_scissors;\n static int add_message_id;\n-static int use_inbody_headers = 1;\n \n #define MAX_HDR_PARSED 10\n #define MAX_BOUNDARIES 5\n@@ -795,17 +794,10 @@ static int handle_commit_msg(struct strbuf *line)\n \tif (still_looking) {\n \t\tif (!line->len || (line->len == 1 && line->buf[0] == '\\n'))\n \t\t\treturn 0;\n-\t}\n-\n-\tif (use_inbody_headers && still_looking) {\n \t\tstill_looking = check_header(line, s_hdr_data, 0);\n \t\tif (still_looking)\n \t\t\treturn 0;\n-\t} else\n-\t\t/* Only trim the first (blank) line of the commit message\n-\t\t * when ignoring in-body headers.\n-\t\t */\n-\t\tstill_looking = 0;\n+\t}\n \n \t/* normalize the log message to UTF-8. */\n \tif (metainfo_charset)\n@@ -1062,8 +1054,6 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)\n \t\t\tuse_scissors = 1;\n \t\telse if (!strcmp(argv[1], \"--no-scissors\"))\n \t\t\tuse_scissors = 0;\n-\t\telse if (!strcmp(argv[1], \"--no-inbody-headers\"))\n-\t\t\tuse_inbody_headers = 0;\n \t\telse\n \t\t\tusage(mailinfo_usage);\n \t\targc--; argv++;\ndiff --git a/git-am.sh b/git-am.sh\nindex 761befb..df403b0 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -372,7 +372,7 @@ split_patches () {\n prec=4\n dotest=\"$GIT_DIR/rebase-apply\"\n sign= utf8=t keep= keepcr= skip= interactive= resolved= rebasing= abort=\n-messageid= resolvemsg= resume= scissors= no_inbody_headers=\n+messageid= resolvemsg= resume= scissors=\n git_apply_opt=\n committer_date_is_author_date=\n ignore_date=\n@@ -579,7 +579,6 @@ Use \\\"git am --abort\\\" to remove it.\")\"\n \techo \"$keep\" >\"$dotest/keep\"\n \techo \"$messageid\" >\"$dotest/messageid\"\n \techo \"$scissors\" >\"$dotest/scissors\"\n-\techo \"$no_inbody_headers\" >\"$dotest/no_inbody_headers\"\n \techo \"$GIT_QUIET\" >\"$dotest/quiet\"\n \techo 1 >\"$dotest/next\"\n \tif test -n \"$rebasing\"\n@@ -644,12 +643,6 @@ t)\n f)\n \tscissors=--no-scissors ;;\n esac\n-if test \"$(cat \"$dotest/no_inbody_headers\")\" = t\n-then\n-\tno_inbody_headers=--no-inbody-headers\n-else\n-\tno_inbody_headers=\n-fi\n if test \"$(cat \"$dotest/quiet\")\" = t\n then\n \tGIT_QUIET=t\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex e97cfb2..b2b5be6 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -31,10 +31,6 @@ do\n \t\tthen\n \t\t\tcheck_mailinfo $mail --scissors\n \t\tfi &&\n-\t\tif test -f \"$TEST_DIRECTORY\"/t5100/msg$mail--no-inbody-headers\n-\t\tthen\n-\t\t\tcheck_mailinfo $mail --no-inbody-headers\n-\t\tfi &&\n \t\tif test -f \"$TEST_DIRECTORY\"/t5100/msg$mail--message-id\n \t\tthen\n \t\t\tcheck_mailinfo $mail --message-id\ndiff --git a/t/t5100/info0015--no-inbody-headers b/t/t5100/info0015--no-inbody-headers\ndeleted file mode 100644\nindex c4d8d77..0000000\n--- a/t/t5100/info0015--no-inbody-headers\n+++ /dev/null\n@@ -1,5 +0,0 @@\n-Author: A U Thor\n-Email: a.u.thor@example.com\n-Subject: check bogus body header (from)\n-Date: Fri, 9 Jun 2006 00:44:16 -0700\n-\ndiff --git a/t/t5100/info0016--no-inbody-headers b/t/t5100/info0016--no-inbody-headers\ndeleted file mode 100644\nindex f4857d4..0000000\n--- a/t/t5100/info0016--no-inbody-headers\n+++ /dev/null\n@@ -1,5 +0,0 @@\n-Author: A U Thor\n-Email: a.u.thor@example.com\n-Subject: check bogus body header (date)\n-Date: Fri, 9 Jun 2006 00:44:16 -0700\n-\ndiff --git a/t/t5100/msg0015--no-inbody-headers b/t/t5100/msg0015--no-inbody-headers\ndeleted file mode 100644\nindex be5115b..0000000\n--- a/t/t5100/msg0015--no-inbody-headers\n+++ /dev/null\n@@ -1,3 +0,0 @@\n-From: bogosity\n-  - a list\n-  - of stuff\ndiff --git a/t/t5100/msg0016--no-inbody-headers b/t/t5100/msg0016--no-inbody-headers\ndeleted file mode 100644\nindex 1063f51..0000000\n--- a/t/t5100/msg0016--no-inbody-headers\n+++ /dev/null\n@@ -1,4 +0,0 @@\n-Date: bogus\n-\n-and some content\n-\ndiff --git a/t/t5100/patch0015--no-inbody-headers b/t/t5100/patch0015--no-inbody-headers\ndeleted file mode 100644\nindex ad64848..0000000\n--- a/t/t5100/patch0015--no-inbody-headers\n+++ /dev/null\n@@ -1,8 +0,0 @@\n----\n-diff --git a/foo b/foo\n-index e69de29..d95f3ad 100644\n---- a/foo\n-+++ b/foo\n-@@ -0,0 +1 @@\n-+content\n-\ndiff --git a/t/t5100/patch0016--no-inbody-headers b/t/t5100/patch0016--no-inbody-headers\ndeleted file mode 100644\nindex ad64848..0000000\n--- a/t/t5100/patch0016--no-inbody-headers\n+++ /dev/null\n@@ -1,8 +0,0 @@\n----\n-diff --git a/foo b/foo\n-index e69de29..d95f3ad 100644\n---- a/foo\n-+++ b/foo\n-@@ -0,0 +1 @@\n-+content\n-\n-- \n2.1.4\n"},{"id":"263922","messageId":"e9f6878d93bc7946be9116f02f023d64@www.dscho.org","threadId":"39641","inReplyTo":"1434445392-6265-1-git-send-email-pyokagan@gmail.com","subject":"Re: [PATCH/RFC] Revert \"git am/mailinfo: Don't look at in-body headers when rebasing\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-06-16T09:47:11Z","receivedAt":"2015-06-16T09:47:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Paul,\n\nOn 2015-06-16 11:03, Paul Tan wrote:\n> This reverts commit d25e51596be9271ad833805a3d6f9012dc24ee79, removing\n> git-mailsplit's --no-inbody-headers option.\n> \n> While --no-inbody-headers was introduced to prevent commit messages from\n> being munged by git-mailinfo while rebasing, the need for this option\n> disappeared since 5e835ca (rebase: do not munge commit log message,\n> 2008-04-16), as git-am bypasses git-mailinfo and gets the commit message\n> directly from the commit ID in the patch.\n> \n> git-am is the only user of --no-inbody-headers, and this option is not\n> documented. As such, it should be removed.\n\nMakes sense to me.\n\n> Notes:\n>     The other direction, of course, is to turn --no-inbody-headers into a\n>     supported, documented option in both git-mailsplit and git-am.\n>     \n>     I do also wonder if we should just ensure that git-format-patch does not\n>     generate a message that start with \"From\" or \"Date\".\n\nIn case we need this option for anything in the future, we can easily resurrect it from the commit history, so removing the option the appropriate course of action, methinks.\n\nCiao,\nDscho\n"},{"id":"264719","messageId":"CACRoPnRFCZWih-uFMRnqWwOCmeM9=RgUUpQURk4vrZZsDOjGvg@mail.gmail.com","threadId":"39641","inReplyTo":"1434445392-6265-1-git-send-email-pyokagan@gmail.com","subject":"Re: [PATCH/RFC] Revert \"git am/mailinfo: Don't look at in-body headers when rebasing\"","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-06-24T10:36:07Z","receivedAt":"2015-06-24T10:36:07Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"Hi Junio,\n\nOn Tue, Jun 16, 2015 at 5:03 PM, Paul Tan <pyokagan@gmail.com> wrote:\n> This reverts commit d25e51596be9271ad833805a3d6f9012dc24ee79, removing\n> git-mailsplit's --no-inbody-headers option.\n>\n> While --no-inbody-headers was introduced to prevent commit messages from\n> being munged by git-mailinfo while rebasing, the need for this option\n> disappeared since 5e835ca (rebase: do not munge commit log message,\n> 2008-04-16), as git-am bypasses git-mailinfo and gets the commit message\n> directly from the commit ID in the patch.\n>\n> git-am is the only user of --no-inbody-headers, and this option is not\n> documented. As such, it should be removed.\n>\n> Signed-off-by: Paul Tan <pyokagan@gmail.com>\n\nWhat do you think about applying this patch?\n\nEither way, the no-inbody-headers code in git-am.sh is dead code so I\ndon't think I will be implementing it in the git-am rewrite.\n\nThanks,\nPaul\n"},{"id":"264734","messageId":"xmqq616day9j.fsf@gitster.dls.corp.google.com","threadId":"39641","inReplyTo":"CACRoPnRFCZWih-uFMRnqWwOCmeM9=RgUUpQURk4vrZZsDOjGvg@mail.gmail.com","subject":"Re: [PATCH/RFC] Revert \"git am/mailinfo: Don't look at in-body headers when rebasing\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-24T16:04:24Z","receivedAt":"2015-06-24T16:04:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Tan <pyokagan@gmail.com> writes:\n\n> On Tue, Jun 16, 2015 at 5:03 PM, Paul Tan <pyokagan@gmail.com> wrote:\n>> This reverts commit d25e51596be9271ad833805a3d6f9012dc24ee79, removing\n>> git-mailsplit's --no-inbody-headers option.\n>>\n>> While --no-inbody-headers was introduced to prevent commit messages from\n>> being munged by git-mailinfo while rebasing, the need for this option\n>> disappeared since 5e835ca (rebase: do not munge commit log message,\n>> 2008-04-16), as git-am bypasses git-mailinfo and gets the commit message\n>> directly from the commit ID in the patch.\n>>\n>> git-am is the only user of --no-inbody-headers, and this option is not\n>> documented. As such, it should be removed.\n>>\n>> Signed-off-by: Paul Tan <pyokagan@gmail.com>\n>\n> What do you think about applying this patch?\n\nIndifferent, even though it would be the right thing to do in the\nlonger term.\n\nKeeping what we think nobody uses does not hurt us at least in the\nshort term; removing such a thing hurts us if it turns out that\nsomebody whose use we didn't know about were actually using it.\n\nAnd my time is better spent at this point in the cycle on other\nthings than having to worry about possible fallouts from the removal\nthat is not urgent.\n"}]}