{"thread":{"id":"8894","subject":"[PATCH] git-commit: don't add multiple Signed-off-by: from the same identity","startedAt":"2007-07-06T14:42:27Z","lastAt":"2007-07-08T18:44:47Z","messageCount":5,"participants":["Gerrit Pape","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46626","messageId":"20070706144227.11736.qmail@046ba2bc1a0185.315fe32.mid.smarden.org","threadId":"8894","inReplyTo":null,"subject":"[PATCH] git-commit: don't add multiple Signed-off-by: from the same identity","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-07-06T14:42:27Z","receivedAt":"2007-07-06T14:42:27Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"If requested to signoff a commit, don't add another Signed-off-by: line\nto the commit message if the exact same line is already there.\n\nThis was noticed and requested by Josh Triplett through\n http://bugs.debian.org/430851\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n git-commit.sh |   20 +++++++++++---------\n 1 files changed, 11 insertions(+), 9 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex f866f95..7a7d19a 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -458,16 +458,18 @@ fi | git stripspace >\"$GIT_DIR\"/COMMIT_EDITMSG\n \n case \"$signoff\" in\n t)\n-\tneed_blank_before_signoff=\n+\tsign=$(git-var GIT_COMMITTER_IDENT | sed -e '\n+\t\ts/>.*/>/\n+\t\ts/^/Signed-off-by: /\n+\t\t')\n+\tblank_before_signoff=\n \ttail -n 1 \"$GIT_DIR\"/COMMIT_EDITMSG |\n-\tgrep 'Signed-off-by:' >/dev/null || need_blank_before_signoff=yes\n-\t{\n-\t\ttest -z \"$need_blank_before_signoff\" || echo\n-\t\tgit-var GIT_COMMITTER_IDENT | sed -e '\n-\t\t\ts/>.*/>/\n-\t\t\ts/^/Signed-off-by: /\n-\t\t'\n-\t} >>\"$GIT_DIR\"/COMMIT_EDITMSG\n+\tgrep 'Signed-off-by:' >/dev/null || blank_before_signoff='\n+'\n+\ttail -n 1 \"$GIT_DIR\"/COMMIT_EDITMSG |\n+\tgrep \"$sign\"$ >/dev/null ||\n+\tprintf '%s%s\\n' \"$blank_before_signoff\" \"$sign\" \\\n+\t\t>>\"$GIT_DIR\"/COMMIT_EDITMSG\n \t;;\n esac\n \n-- \n1.5.2.1\n"},{"id":"46627","messageId":"20070706144543.12001.qmail@562ca05ec1cc76.315fe32.mid.smarden.org","threadId":"8894","inReplyTo":"20070706144227.11736.qmail@046ba2bc1a0185.315fe32.mid.smarden.org","subject":"[PATCH] git-commit: add commit.signoff config option","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-07-06T14:45:43Z","receivedAt":"2007-07-06T14:45:43Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"Have the commit.signoff boolean config option automatically add a\nSigned-off-by: by git-commit, without giving the -s switch explicitly.\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n git-commit.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex 7a7d19a..b493820 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -275,6 +275,7 @@ $1\"\n \tesac\n done\n case \"$edit_flag\" in t) no_edit= ;; esac\n+test \"$(git config --bool commit.signoff)\" != true || signoff=t\n \n ################################################################\n # Sanity check options\n-- \n1.5.2.1\n"},{"id":"46652","messageId":"7vy7hte717.fsf@assigned-by-dhcp.cox.net","threadId":"8894","inReplyTo":"20070706144227.11736.qmail@046ba2bc1a0185.315fe32.mid.smarden.org","subject":"Re: [PATCH] git-commit: don't add multiple Signed-off-by: from the same identity","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-06T18:11:48Z","receivedAt":"2007-07-06T18:11:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"If you are trying to avoid a run of Signed-off-by: lines like this:\n\n\tSigned-off-by: Original Author <oa@example.com>\n\tSigned-off-by: First Reviewer <fr@example.com>\n\tSigned-off-by: Second Reviewer <sr@example.com>\n\tSigned-off-by: Original Author <oa@example.com>\n\tSigned-off-by: Subsystem Integrator <si@example.com>\n\nIt is not a bug.  If the last signed-off-by is not from\nyourself, your signed-off-by is added when you ask with \"-s\",\nand this is very much intentionally done to follow the existing\npractice of patch passing done in the kernel community, where\nSigned-off-by: was invented (Linus or somebody from the kernel\ncircle can correct me if I am wrong).\n\nWhen you are passing patches around, tweaks to the patch\ncontents can be made.  If your patch comes back to you from the\nsecond reviewer, it is not what you originally sent out.  You\nwould want to sign it off again.\n\nWe have deliberately excluded what your other patch tries to do\nfor a reason.  Even though these lines are not digitally signed,\nthe intent of adding a Signed-off-by: line with your name is\nthat you are certifying its origin, according to the definition\nof DCO (see Documentation/SubmittingPatches).  This should be a\nconscious act from the signer's part, and making it automatic\nwith a config variable that you set once and forget makes it\nmuch less meaningful.\n\n\n\n        \n\n        \n"},{"id":"46761","messageId":"20070708150055.7018.qmail@10e1f648410572.315fe32.mid.smarden.org","threadId":"8894","inReplyTo":"7vy7hte717.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-commit: don't add multiple Signed-off-by: from the same identity","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-07-08T15:00:55Z","receivedAt":"2007-07-08T15:00:55Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Fri, Jul 06, 2007 at 11:11:48AM -0700, Junio C Hamano wrote:\n> If you are trying to avoid a run of Signed-off-by: lines like this:\n> \n> \tSigned-off-by: Original Author <oa@example.com>\n> \tSigned-off-by: First Reviewer <fr@example.com>\n> \tSigned-off-by: Second Reviewer <sr@example.com>\n> \tSigned-off-by: Original Author <oa@example.com>\n> \tSigned-off-by: Subsystem Integrator <si@example.com>\n> \n> It is not a bug.  If the last signed-off-by is not from\n> yourself, your signed-off-by is added when you ask with \"-s\",\n\nThis is what the patch does, it only checks against the final line,\nsorry, the subject is incorrect.  The behavior currently is\n\n $ ./git-commit -m foo foo\n Created commit 2fad03e: foo\n  0 files changed, 0 insertions(+), 0 deletions(-)\n  create mode 100644 foo\n $ EDITOR=cat ./git-commit --amend -s foo |head -n4\n foo\n\n Signed-off-by: Gerrit Pape <pape@smarden.org>\n\n $ EDITOR=cat ./git-commit --amend -s foo |head -n4\n foo\n\n Signed-off-by: Gerrit Pape <pape@smarden.org>\n Signed-off-by: Gerrit Pape <pape@smarden.org>\n $ \n\nwith the patch, iff the last line already was the signoff to be added,\nit won't be added again.\n\n> We have deliberately excluded what your other patch tries to do\n> for a reason.  Even though these lines are not digitally signed,\n> the intent of adding a Signed-off-by: line with your name is\n> that you are certifying its origin, according to the definition\n> of DCO (see Documentation/SubmittingPatches).  This should be a\n> conscious act from the signer's part, and making it automatic\n> with a config variable that you set once and forget makes it\n> much less meaningful.\n\nOkay, to me personally it would be convenient, for the git repository I\nhave no problem with, and want to simply singoff all commits, for other\nrepos none.\n\nRegards, Gerrit.\n"},{"id":"46778","messageId":"7vr6ni20rk.fsf@assigned-by-dhcp.cox.net","threadId":"8894","inReplyTo":"20070708150055.7018.qmail@10e1f648410572.315fe32.mid.smarden.org","subject":"Re: [PATCH] git-commit: don't add multiple Signed-off-by: from the same identity","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-08T18:44:47Z","receivedAt":"2007-07-08T18:44:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Gerrit Pape <pape@smarden.org> writes:\n\n> with the patch, iff the last line already was the signoff to be added,\n> it won't be added again.\n\nAh, I completely misread the patch.  Thanks.\n"}]}