{"thread":{"id":"27519","subject":"[PATCH 1/1] git-am: provide configuration to enable signoff by default","startedAt":"2011-06-01T08:42:31Z","lastAt":"2011-06-02T19:41:48Z","messageCount":9,"participants":["Sekhar Nori","Sverre Rabbelier","Jeff King","Junio C Hamano","Nori, Sekhar","Jonathan Nieder","Thiago Farina"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"169101","messageId":"1306917751-27999-1-git-send-email-nsekhar@ti.com","threadId":"27519","inReplyTo":null,"subject":"[PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Sekhar Nori","fromEmail":"nsekhar@ti.com","sentAt":"2011-06-01T08:42:31Z","receivedAt":"2011-06-01T08:42:31Z","isPatch":true,"sender":{"key":"nsekhar@ti.com","avatar":null},"body":"Provide a git config option to enable --signoff a\ndefault when using git-am. This should be handy\nfor maintainers who regularly apply patches from\nmailing lists to send them upstream and want to\nbe on the sign-off path.\n\nSigned-off-by: Sekhar Nori <nsekhar@ti.com>\n---\n Documentation/config.txt |    7 +++++++\n Documentation/git-am.txt |    3 ++-\n git-am.sh                |    5 +++++\n 3 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 6b93777..5da7ca8 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -597,6 +597,13 @@ am.keepcr::\n \tby giving '--no-keep-cr' from the command line.\n \tSee linkgit:git-am[1], linkgit:git-mailsplit[1].\n \n+am.signoff::\n+\tA boolean value which lets you enable the `-s/--signoff` option of\n+\tam by default. *Note:* Adding the Signed-off-by: line to a patch\n+\tshould be a conscious act and means that you certify you have\n+\tthe rights to submit this work under the same open source license.\n+\tPlease see the 'SubmittingPatches' document for further discussion.\n+\n apply.ignorewhitespace::\n \tWhen set to 'change', tells 'git apply' to ignore changes in\n \twhitespace, in the same way as the '--ignore-space-change'\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 6b1b5af..6b2c51a 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -33,7 +33,8 @@ OPTIONS\n -s::\n --signoff::\n \tAdd a `Signed-off-by:` line to the commit message, using\n-\tthe committer identity of yourself.\n+\tthe committer identity of yourself. `am.signoff` configuration\n+\tvariable can be used to make this the defaut.\n \n -k::\n --keep::\ndiff --git a/git-am.sh b/git-am.sh\nindex 6cdd591..8e2a693 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -328,6 +328,11 @@ then\n     keepcr=t\n fi\n \n+if test \"$(git config --bool --get am.signoff)\" = true\n+then\n+    sign=t\n+fi\n+\n while test $# != 0\n do\n \tcase \"$1\" in\n-- \n1.7.3.2\n"},{"id":"169119","messageId":"BANLkTinorC17+21SA44Eg26GHERSpLb0Rw@mail.gmail.com","threadId":"27519","inReplyTo":"1306917751-27999-1-git-send-email-nsekhar@ti.com","subject":"Re: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-06-01T16:03:14Z","receivedAt":"2011-06-01T16:03:14Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Jun 1, 2011 at 03:42, Sekhar Nori <nsekhar@ti.com> wrote:\n> Provide a git config option to enable --signoff a\n> default when using git-am. This should be handy\n> for maintainers who regularly apply patches from\n> mailing lists to send them upstream and want to\n> be on the sign-off path.\n\nWouldn't this need tests?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"169126","messageId":"20110601163919.GC7132@sigill.intra.peff.net","threadId":"27519","inReplyTo":"1306917751-27999-1-git-send-email-nsekhar@ti.com","subject":"Re: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-06-01T16:39:19Z","receivedAt":"2011-06-01T16:39:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 01, 2011 at 02:12:31PM +0530, Sekhar Nori wrote:\n\n> Provide a git config option to enable --signoff a\n> default when using git-am. This should be handy\n> for maintainers who regularly apply patches from\n> mailing lists to send them upstream and want to\n> be on the sign-off path.\n\nI think people have complained about auto-signoff features before,\nbecause it was supposed to be a conscious act. I don't recall if it was\never resolved, and I don't have an opinion myself, but it may be worth\nsearching the archives for past arguments.\n\n> diff --git a/git-am.sh b/git-am.sh\n> index 6cdd591..8e2a693 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -328,6 +328,11 @@ then\n>      keepcr=t\n>  fi\n>  \n> +if test \"$(git config --bool --get am.signoff)\" = true\n> +then\n> +    sign=t\n> +fi\n> +\n>  while test $# != 0\n>  do\n>  \tcase \"$1\" in\n\nShouldn't this be turned off if --rebasing is passed? Otherwise you\nwould introduce signoffs during rebase (I didn't check, though, so maybe\nthere is some other mechanism preventing it).\n\n-Peff\n"},{"id":"169130","messageId":"7voc2hh3t5.fsf@alter.siamese.dyndns.org","threadId":"27519","inReplyTo":"1306917751-27999-1-git-send-email-nsekhar@ti.com","subject":"Re: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-06-01T17:14:30Z","receivedAt":"2011-06-01T17:14:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sekhar Nori <nsekhar@ti.com> writes:\n\n> +am.signoff::\n> +\tA boolean value which lets you enable the `-s/--signoff` option of\n> +\tam by default. *Note:* Adding the Signed-off-by: line to a patch\n> +\tshould be a conscious act and means that you certify you have\n> +\tthe rights to submit this work under the same open source license.\n> +\tPlease see the 'SubmittingPatches' document for further discussion.\n\nI see you already have done your homework, which is much better than\nprevious attempts by other people to add an option to add sign-off to\nvarious commands (commit and format-patch), but there are at least three\nproblems here:\n\n * This is an end-user document, not a document for git developers, so\n   they are not bound by SubmittingPatches at all. They do not necessarily\n   have SubmittingPatches document in the first place;\n\n * Once you set this configuration variable, I do not see a way to\n   countermand \"This is not signed-off\" from the command line for a single\n   invocation of \"am\" in your patch;\n\n * If it should be a \"conscious act\", it shouldn't be \"set once and forget\n   about it\" configuration option. You should be making the conscious\n   decision for each piece of e-mail if it is in line with the project's\n   Sign-off policy.\n\nThe last one means that the patch is internally inconsistent. In a project\n(not this project) where sign-off is used but it does not require signing\noff to be a conscious act, I see it may make sense to make it easier to\nsign-off a patch when generating (i.e. \"commit -s\"), preparing to send\n(i.e. \"format-patch -s\"), or accepting (i.e. \"am -s\"). And this option\nmight be a possible way to do so. But in that case, the option description\nwouldn't say \"it should be a conscious act\".\n\nAlso if it doesn't have to be a conscious act, what value does such a\nboilerplate have? Such a project may be better off not using sign-off at\nall to begin with.\n"},{"id":"169136","messageId":"B85A65D85D7EB246BE421B3FB0FBB593024D2D22DE@dbde02.ent.ti.com","threadId":"27519","inReplyTo":"7voc2hh3t5.fsf@alter.siamese.dyndns.org","subject":"RE: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Nori, Sekhar","fromEmail":"nsekhar@ti.com","sentAt":"2011-06-01T18:27:25Z","receivedAt":"2011-06-01T18:27:25Z","isPatch":true,"sender":{"key":"nsekhar@ti.com","avatar":null},"body":"Hi Junio,\n\nOn Wed, Jun 01, 2011 at 22:44:30, Junio C Hamano wrote:\n> Sekhar Nori <nsekhar@ti.com> writes:\n> \n> > +am.signoff::\n> > +\tA boolean value which lets you enable the `-s/--signoff` option of\n> > +\tam by default. *Note:* Adding the Signed-off-by: line to a patch\n> > +\tshould be a conscious act and means that you certify you have\n> > +\tthe rights to submit this work under the same open source license.\n> > +\tPlease see the 'SubmittingPatches' document for further discussion.\n> \n> I see you already have done your homework, which is much better than\n> previous attempts by other people to add an option to add sign-off to\n> various commands (commit and format-patch), but there are at least three\n> problems here:\n\nYes, I guessed there would have been previous attempts at this\nand actually did search the mail archives a bit before sending\nthe patch. I actually didn't hit anything so looks like I probably\nused the wrong keywords.\n\n>  * This is an end-user document, not a document for git developers, so\n>    they are not bound by SubmittingPatches at all. They do not necessarily\n>    have SubmittingPatches document in the first place;\n\nI will be honest here, I just took this note from the existing documentation \nfor format.signoff config option. May be I can instead say: \"Please check the \nguidelines on submitting patches for your project for further discussion on \nthis. 'SubmittingPatches' document in Linux kernel or 'git' sources is an \nexample of such a document.\"\n\n>  * Once you set this configuration variable, I do not see a way to\n>    countermand \"This is not signed-off\" from the command line for a single\n>    invocation of \"am\" in your patch;\n\nOkay. I guess adding an --no-signoff to git am should help here?\n\n> \n>  * If it should be a \"conscious act\", it shouldn't be \"set once and forget\n>    about it\" configuration option. You should be making the conscious\n>    decision for each piece of e-mail if it is in line with the project's\n>    Sign-off policy.\n> \n> The last one means that the patch is internally inconsistent. In a project\n> (not this project) where sign-off is used but it does not require signing\n> off to be a conscious act, I see it may make sense to make it easier to\n> sign-off a patch when generating (i.e. \"commit -s\"), preparing to send\n> (i.e. \"format-patch -s\"), or accepting (i.e. \"am -s\"). And this option\n> might be a possible way to do so. But in that case, the option description\n> wouldn't say \"it should be a conscious act\".\n> \n> Also if it doesn't have to be a conscious act, what value does such a\n> boilerplate have? Such a project may be better off not using sign-off at\n> all to begin with.\n\nIts hard to argue against this. All I would say is it is probably\nmuch safer to enable sign off by default when accepting a patch\nthan when preparing to send it. Yet, we have format.signoff but\nno am.signoff. On any project with conscious sign-off rules, one\nwould never accept a patch without a sign-off from the original\ndeveloper.\n\nSo, just making it easier to accept patches which are already\nsigned-off should be okay, I guess? May be we should look for\nan existing sign-off in the mbox and only then have this option\ncome into play?\n\nThanks,\nSekhar\n"},{"id":"169141","messageId":"20110601191623.GA9836@elie","threadId":"27519","inReplyTo":"B85A65D85D7EB246BE421B3FB0FBB593024D2D22DE@dbde02.ent.ti.com","subject":"Re: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-06-01T19:23:57Z","receivedAt":"2011-06-01T19:23:57Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nori, Sekhar wrote:\n> On Wed, Jun 01, 2011 at 22:44:30, Junio C Hamano wrote:\n\n>> Also if it doesn't have to be a conscious act, what value does such a\n>> boilerplate have? Such a project may be better off not using sign-off at\n>> all to begin with.\n>\n> Its hard to argue against this. All I would say is it is probably\n> much safer to enable sign off by default when accepting a patch\n> than when preparing to send it. Yet, we have format.signoff but\n> no am.signoff. On any project with conscious sign-off rules, one\n> would never accept a patch without a sign-off from the original\n> developer.\n\nIn that case, just the first sign-off should be enough and there is no\nneed to record the later ones, no?\n\nIn practice, with format.signoff hopefully people read the patches\nthey are sending out before mailing them.  It is very easy to remove\nthe sign-off in an MUA or by editing patch files before running\n\"git send-email\" if it was inappropriate.  On the contrary, importing\npatches en masse with \"git am\" is a common operation and I suspect\nlooking over the new history in detail before a \"git push\" is rare, so\nthe possibility of someone forgetting that an \"[am] signOff\" variable\nis in effect is much more dangerous.\n\nThat said, I am all for giving people rope as long as there is some\nlegitimate use case documented to explain how not to hang themselves.\nCould you say more about the example that motivated this?  What\nbenefit would this provide to motivate not using \"git am -3sc\" (which\ncontains the -s on the commandline as a reminder)?\n\n> So, just making it easier to accept patches which are already\n> signed-off should be okay, I guess?\n\nA related idea seems interesting: would a --check-sign-off option that\nprevents applying a patch unless the last sign-off matches the email\nsender be useful?  Unfortunately individual people sometimes use\ndifferent addresses for the From and Signed-off-by lines in some\nprojects (like git and the Linux kernel) so I don't think I'd use such\na thing but in a more controlled environment I can imagine it might be\nnice.\n\nThanks.\n\nSorry for the longwinded message; still, hope that helps.\n\nRegards,\nJonathan\n"},{"id":"169215","messageId":"B85A65D85D7EB246BE421B3FB0FBB593024D2D2913@dbde02.ent.ti.com","threadId":"27519","inReplyTo":"20110601191623.GA9836@elie","subject":"RE: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Nori, Sekhar","fromEmail":"nsekhar@ti.com","sentAt":"2011-06-02T19:05:24Z","receivedAt":"2011-06-02T19:05:24Z","isPatch":true,"sender":{"key":"nsekhar@ti.com","avatar":null},"body":"Hi Jonathan,\n\nOn Thu, Jun 02, 2011 at 00:53:57, Jonathan Nieder wrote:\n> Nori, Sekhar wrote:\n> > On Wed, Jun 01, 2011 at 22:44:30, Junio C Hamano wrote:\n> \n> >> Also if it doesn't have to be a conscious act, what value does such a\n> >> boilerplate have? Such a project may be better off not using sign-off at\n> >> all to begin with.\n> >\n> > Its hard to argue against this. All I would say is it is probably\n> > much safer to enable sign off by default when accepting a patch\n> > than when preparing to send it. Yet, we have format.signoff but\n> > no am.signoff. On any project with conscious sign-off rules, one\n> > would never accept a patch without a sign-off from the original\n> > developer.\n> \n> In that case, just the first sign-off should be enough and there is no\n> need to record the later ones, no?\n\nWell, it is required to keep track of who was in the upstream\npath. This way all relevant folks can be contacted in case\nthe patch introduces a problem.\n\n> \n> In practice, with format.signoff hopefully people read the patches\n> they are sending out before mailing them.  It is very easy to remove\n> the sign-off in an MUA or by editing patch files before running\n> \"git send-email\" if it was inappropriate.  On the contrary, importing\n> patches en masse with \"git am\" is a common operation and I suspect\n> looking over the new history in detail before a \"git push\" is rare, so\n> the possibility of someone forgetting that an \"[am] signOff\" variable\n> is in effect is much more dangerous.\n> \n> That said, I am all for giving people rope as long as there is some\n> legitimate use case documented to explain how not to hang themselves.\n> Could you say more about the example that motivated this?  What\n> benefit would this provide to motivate not using \"git am -3sc\" (which\n> contains the -s on the commandline as a reminder)?\n\nOkay, here is the issue that prompted me to work on this:\n\nhttp://linux.davincidsp.com/pipermail/davinci-linux-open-source/2011-May/022832.html\n\nI think this option is useful for maintainers who usually do not\napply patches en-masse, but accept patches after review and want to\npass along to other upstream maintainers after adding their sign-off.\n\nGranted you can always rely on -s option to be added, but people do\nforget (like I did).\n\n> > So, just making it easier to accept patches which are already\n> > signed-off should be okay, I guess?\n> \n> A related idea seems interesting: would a --check-sign-off option that\n> prevents applying a patch unless the last sign-off matches the email\n> sender be useful?  Unfortunately individual people sometimes use\n> different addresses for the From and Signed-off-by lines in some\n> projects (like git and the Linux kernel) so I don't think I'd use such\n> a thing but in a more controlled environment I can imagine it might be\n> nice.\n\nIf you received any patch with a sign-off, I think it is usually\nsafe to attach your own sign-off since then the origin of the\npatch is already certified by someone else (you would be adding\nyour sign-off under Developer's Certificate of Origin 1.1 section\n(c))\n\nThanks,\nSekhar\n"},{"id":"169216","messageId":"B85A65D85D7EB246BE421B3FB0FBB593024D2D2916@dbde02.ent.ti.com","threadId":"27519","inReplyTo":"BANLkTinorC17+21SA44Eg26GHERSpLb0Rw@mail.gmail.com","subject":"RE: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Nori, Sekhar","fromEmail":"nsekhar@ti.com","sentAt":"2011-06-02T19:10:30Z","receivedAt":"2011-06-02T19:10:30Z","isPatch":true,"sender":{"key":"nsekhar@ti.com","avatar":null},"body":"Hi Sverre,\n\nOn Wed, Jun 01, 2011 at 21:33:14, Sverre Rabbelier wrote:\n> Heya,\n> \n> On Wed, Jun 1, 2011 at 03:42, Sekhar Nori <nsekhar@ti.com> wrote:\n> > Provide a git config option to enable --signoff a\n> > default when using git-am. This should be handy\n> > for maintainers who regularly apply patches from\n> > mailing lists to send them upstream and want to\n> > be on the sign-off path.\n> \n> Wouldn't this need tests?\n\nYes, I did test this (by applying mailbox with and\nwithout this option turned on). Didn't actually try\nwith --rebasing that Jeff asked for in another e-mail.\n\nI should have included test information in the patch\ndescription.\n\nAt this point I am not sure if this patch will be\nconsidered for inclusion. If I get to submit another\nversion of it, I will surely add this info.\n\nThanks,\nSekhar\n"},{"id":"169218","messageId":"BANLkTin8s72OFDg_qqGrCsiALDCYHGSTUQ@mail.gmail.com","threadId":"27519","inReplyTo":"B85A65D85D7EB246BE421B3FB0FBB593024D2D2916@dbde02.ent.ti.com","subject":"Re: [PATCH 1/1] git-am: provide configuration to enable signoff by default","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2011-06-02T19:41:48Z","receivedAt":"2011-06-02T19:41:48Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Thu, Jun 2, 2011 at 4:10 PM, Nori, Sekhar <nsekhar@ti.com> wrote:\n> At this point I am not sure if this patch will be\n> considered for inclusion. If I get to submit another\n> version of it, I will surely add this info.\n>\nI think he is talking about the tests under the t/ directory (the git\ntest suite). You can take a look at many examples there.\n"}]}