{"thread":{"id":"56753","subject":"git format-patch --signoff","startedAt":"2021-10-21T21:22:19Z","lastAt":"2021-10-21T23:37:21Z","messageCount":5,"participants":["Michał Mirosław","brian m. carlson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"439287","messageId":"YXHaAu2G51vy5H8z@qmqm.qmqm.pl","threadId":"56753","inReplyTo":null,"subject":"git format-patch --signoff","fromName":"Michał Mirosław","fromEmail":"mirq-linux@rere.qmqm.pl","sentAt":"2021-10-21T21:22:10Z","receivedAt":"2021-10-21T21:22:19Z","isPatch":false,"sender":{"key":"mirq-linux@rere.qmqm.pl","avatar":null},"body":"Hi.\n\nI just noticed that `git format-patch --signoff` adds the 'Signed-off-by'\nline even if the exact same line is already present in the commit message.\nCould this be avoided in the tool?\n\ngit version 2.30.2\n\nBest Regards\nMichał Mirosław\n"},{"id":"439288","messageId":"YXHcjbiE6GX6zJHk@camp.crustytoothpaste.net","threadId":"56753","inReplyTo":"YXHaAu2G51vy5H8z@qmqm.qmqm.pl","subject":"Re: git format-patch --signoff","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-10-21T21:33:01Z","receivedAt":"2021-10-21T21:33:47Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-10-21 at 21:22:10, Michał Mirosław wrote:\n> Hi.\n> \n> I just noticed that `git format-patch --signoff` adds the 'Signed-off-by'\n> line even if the exact same line is already present in the commit message.\n> Could this be avoided in the tool?\n\nJust so I understand correctly, does it do this even if the existing\nsign-off is last (or the only one), or only if the sign-off is not the\nlast?\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"439290","messageId":"YXHj74OPJmFqamxP@qmqm.qmqm.pl","threadId":"56753","inReplyTo":"YXHcjbiE6GX6zJHk@camp.crustytoothpaste.net","subject":"Re: git format-patch --signoff","fromName":"Michał Mirosław","fromEmail":"mirq-linux@rere.qmqm.pl","sentAt":"2021-10-21T22:04:31Z","receivedAt":"2021-10-21T22:04:35Z","isPatch":false,"sender":{"key":"mirq-linux@rere.qmqm.pl","avatar":null},"body":"On Thu, Oct 21, 2021 at 09:33:01PM +0000, brian m. carlson wrote:\n> On 2021-10-21 at 21:22:10, Michał Mirosław wrote:\n> > Hi.\n> > \n> > I just noticed that `git format-patch --signoff` adds the 'Signed-off-by'\n> > line even if the exact same line is already present in the commit message.\n> > Could this be avoided in the tool?\n> Just so I understand correctly, does it do this even if the existing\n> sign-off is last (or the only one), or only if the sign-off is not the\n> last?\n\nIt does this regardless of where the signoff is or whether it is the\nonly one.\n\nBest Regards\nMichał Mirosław\n"},{"id":"439297","messageId":"xmqqo87ihurk.fsf@gitster.g","threadId":"56753","inReplyTo":"YXHaAu2G51vy5H8z@qmqm.qmqm.pl","subject":"Re: git format-patch --signoff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-10-21T22:34:39Z","receivedAt":"2021-10-21T22:34:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michał Mirosław <mirq-linux@rere.qmqm.pl> writes:\n\n> I just noticed that `git format-patch --signoff` adds the 'Signed-off-by'\n> line even if the exact same line is already present in the commit message.\n> Could this be avoided in the tool?\n>\n> git version 2.30.2\n>\n> Best Regards\n> Michał Mirosław\n\nThe rule should be \"avoid adding the same sign-off as the one at the\nend\".  In other words, as a record of the flow of patch custody,\n\n    Signed-off-by: original author\n    Signed-off-by: contributing editor\n    Signed-off-by: original author\n\nis perfectly reasonable for a patch originally authored, tweaked by\nan editor and sent back to the author, and further improved by the\noriginal author, while\n\n    Signed-off-by: original author\n    Signed-off-by: contributing editor\n    Signed-off-by: contributing editor\n\nsent back to the original author by the editor would not be sane, as\nthere is no need to repeat the same s-o-b to signal whatever it\nmight imply (e.g.  the editor edited the patch twice before sending\nit back).\n\nThe test in t4014\n\n  https://github.com/git/git/blob/master/t/t4014-format-patch.sh#L1561\n\n    test_expect_success 'signoff: the same signoff at the end' '\n            append_signoff <<-\\EOF >actual &&\n            subject\n\n            body\n\n            Signed-off-by: C O Mitter <committer@example.com>\n            EOF\n            cat >expect <<-\\EOF &&\n            4:Subject: [PATCH] subject\n            8:\n            10:\n            11:Signed-off-by: C O Mitter <committer@example.com>\n            EOF\n            test_cmp expect actual\n    '\n\nIt creates a commit with an existing S-o-b by the same person as the\none running the \"format-patch --signoff\" command (the append-signoff\ntest helper used there (1) creates a commit with the log message fed\nfrom the standard input, (2) runs format-patch --signoff to show the\ncommit and emits the Subject and S-o-b lines in it.  As we can see,\nwe expect that the existing signoff is not followed by another copy\nof the same signoff. \n\nThis test hasn't changed since it was written in Feb 2013, and I\nthink 2.30.2 is recent enough to conform to the rule to pass this\ntest.\n\n"},{"id":"439309","messageId":"YXH5rKsjPIeWSGTE@qmqm.qmqm.pl","threadId":"56753","inReplyTo":"xmqqo87ihurk.fsf@gitster.g","subject":"Re: git format-patch --signoff","fromName":"Michał Mirosław","fromEmail":"mirq-linux@rere.qmqm.pl","sentAt":"2021-10-21T23:37:16Z","receivedAt":"2021-10-21T23:37:21Z","isPatch":false,"sender":{"key":"mirq-linux@rere.qmqm.pl","avatar":null},"body":"On Thu, Oct 21, 2021 at 03:34:39PM -0700, Junio C Hamano wrote:\n> Michał Mirosław <mirq-linux@rere.qmqm.pl> writes:\n> \n> > I just noticed that `git format-patch --signoff` adds the 'Signed-off-by'\n> > line even if the exact same line is already present in the commit message.\n> > Could this be avoided in the tool?\n> >\n> > git version 2.30.2\n> >\n> > Best Regards\n> > Michał Mirosław\n> \n> The rule should be \"avoid adding the same sign-off as the one at the\n> end\".  In other words, as a record of the flow of patch custody,\n[...]\n> This test hasn't changed since it was written in Feb 2013, and I\n> think 2.30.2 is recent enough to conform to the rule to pass this\n> test.\n\nThe test indeed works correctly, and I couldn't reproduce the effect\non a fresh git repo. I finally took a look with hexdump on the output:\nthe culprit was a UTF-8 non-breaking space -- indistinguishable on\na terminal from a normal space. I'm not sure what to think about this...\nSorry for the noise.\n\nBest Regards\nMichał Mirosław\n"}]}