{"thread":{"id":"5690","subject":"[PATCH] svnimport add support for parsing From lines for author","startedAt":"2006-09-25T11:08:13Z","lastAt":"2006-09-28T16:10:17Z","messageCount":6,"participants":["Andy Whitcroft","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27617","messageId":"20060925110813.GA4419@shadowen.org","threadId":"5690","inReplyTo":null,"subject":"[PATCH] svnimport add support for parsing From lines for author","fromName":"Andy Whitcroft","fromEmail":"apw@shadowen.org","sentAt":"2006-09-25T11:08:13Z","receivedAt":"2006-09-25T11:08:13Z","isPatch":true,"sender":{"key":"apw@shadowen.org","avatar":"https://gravatar.com/avatar/d3088262854661a913ef35cc40fedcc270142d4461791142bc1ea0b2a4e2e147?d=mp&s=160"},"body":"svnimport: add support for parsing From: lines for author\n\nWhen commiting a non-signed off contribution you cannot just add\na Signed-off-by: from the author as they did not sign it off.\nBut if you then commit it, and necessarily sign it off yourself,\nthe change appears to be yours.  In this case it is common to use\nthe following form:\n\n\tCommentry\n\n\tFrom: originator <email>\n\tSigned-of-by: me <my email>\n\nNow that we have support for parsing Signed-off-by: for author\ninformation it makes sense to handle From: as well.  This patch\nadds a new -F which will handle From: lines in the comments.  It\nmay be used in combination with -S.\n\nSigned-off-by: Andy Whitcroft <apw@shadowen.org>\n---\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex ed62897..988514e 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -31,7 +31,7 @@ die \"Need SVN:Core 1.2.1 or better\" if $\n $ENV{'TZ'}=\"UTC\";\n \n our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,\n-    $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D,$opt_S);\n+    $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D,$opt_S,$opt_F);\n \n sub usage() {\n \tprint STDERR <<END;\n@@ -39,12 +39,12 @@ Usage: ${\\basename $0}     # fetch/updat\n        [-o branch-for-HEAD] [-h] [-v] [-l max_rev]\n        [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]\n        [-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg]\n-       [-m] [-M regex] [-A author_file] [-S] [SVN_URL]\n+       [-m] [-M regex] [-A author_file] [-S] [-F] [SVN_URL]\n END\n \texit(1);\n }\n \n-getopts(\"A:b:C:dDhiI:l:mM:o:rs:t:T:Suv\") or usage();\n+getopts(\"A:b:C:dDFhiI:l:mM:o:rs:t:T:Suv\") or usage();\n usage if $opt_h;\n \n my $tag_name = $opt_t || \"tags\";\n@@ -548,8 +548,12 @@ sub commit {\n \t\t$committer_name = $committer_email = $author;\n \t}\n \n-\tif ($opt_S && $message =~ /Signed-off-by:\\s+(.*?)\\s+<(.*)>\\s*\\n/) {\n+\tif ($opt_F && $message =~ /From:\\s+(.*?)\\s+<(.*)>\\s*\\n/) {\n \t\t($author_name, $author_email) = ($1, $2);\n+\t\tprint \"Author from From: $1 <$2>\\n\" if ($opt_v);;\n+\t} elsif ($opt_S && $message =~ /Signed-off-by:\\s+(.*?)\\s+<(.*)>\\s*\\n/) {\n+\t\t($author_name, $author_email) = ($1, $2);\n+\t\tprint \"Author from Signed-off-by: $1 <$2>\\n\" if ($opt_v);;\n \t} else {\n \t\t$author_name = $committer_name;\n \t\t$author_email = $committer_email;\n"},{"id":"27656","messageId":"7v7izrtdtw.fsf@assigned-by-dhcp.cox.net","threadId":"5690","inReplyTo":"20060925110813.GA4419@shadowen.org","subject":"Re: [PATCH] svnimport add support for parsing From lines for author","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-26T05:08:11Z","receivedAt":"2006-09-26T05:08:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Whitcroft <apw@shadowen.org> writes:\n\n> svnimport: add support for parsing From: lines for author\n\nPlease do _not_ repeat the summary line in the message body.  It\nis on the Subject: already.\n\n> Now that we have support for parsing Signed-off-by: for author\n> information it makes sense to handle From: as well.\n\nI take that you are referring to Sasha's change in ae35b304; I\nasked for actual svn users for ACK/NACK but I did not hear any.\nCan I understand that you use svnimport for real projects and\nare happy with Sasha's change? --- that would be an ack that\nwould help me sleep better ;-).\n\n> adds a new -F which will handle From: lines in the comments.  It\n> may be used in combination with -S.\n\nThis sort of makes sense but how common is this?\n\nI also wonder instead of piling up custom flags if it is better\nto let match-and-extract pattern be specified from the command\nline.\n"},{"id":"27667","messageId":"4518DC11.5050806@shadowen.org","threadId":"5690","inReplyTo":"7v7izrtdtw.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] svnimport add support for parsing From lines for author","fromName":"Andy Whitcroft","fromEmail":"apw@shadowen.org","sentAt":"2006-09-26T07:51:45Z","receivedAt":"2006-09-26T07:51:45Z","isPatch":true,"sender":{"key":"apw@shadowen.org","avatar":"https://gravatar.com/avatar/d3088262854661a913ef35cc40fedcc270142d4461791142bc1ea0b2a4e2e147?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Andy Whitcroft <apw@shadowen.org> writes:\n> \n>> svnimport: add support for parsing From: lines for author\n> \n> Please do _not_ repeat the summary line in the message body.  It\n> is on the Subject: already.\n\nSorry ... different projects different rules.\n\n>> Now that we have support for parsing Signed-off-by: for author\n>> information it makes sense to handle From: as well.\n> \n> I take that you are referring to Sasha's change in ae35b304; I\n> asked for actual svn users for ACK/NACK but I did not hear any.\n> Can I understand that you use svnimport for real projects and\n> are happy with Sasha's change? --- that would be an ack that\n> would help me sleep better ;-).\n\nHeh.  Yeah I am tracking a small SVN repository which is using the\nkernel DCO.  we have From:/S-o-b: much as akpm uses in -mm.  This was\nthe result of seeing that change and wanting to see if it would pick up\nour sign-offs.  It only seemed deficient in From: handling :).  It seems\nto work well in practice for me.\n\n> \n>> adds a new -F which will handle From: lines in the comments.  It\n>> may be used in combination with -S.\n> \n> This sort of makes sense but how common is this?\n\nI think the kernel DCO has started a trend which will expand to other\nprojects.  The problem it is intended to fix is a general one which\nneeds addressing in all such projects.\n\n> I also wonder instead of piling up custom flags if it is better\n> to let match-and-extract pattern be specified from the command\n> line.\n\nI did look at reusing the -S flag, such that -S would be S-o-b: handling\nand -SS would be S-o-b: and From:, but this script is currently using\nthe old getopt implementation which doesn't record repeats.\n\nSo you're proposing something more like:\n\n    git svn-import -S \"Signed-off-by:\" -S \"From:\" ...\n\nAgain, we'll have to update the options handling to get that kind of\nbehaviour.  How would you feel about -SS in this context.\n\n-apw\n"},{"id":"27760","messageId":"7vfyedj2j2.fsf@assigned-by-dhcp.cox.net","threadId":"5690","inReplyTo":"4518DC11.5050806@shadowen.org","subject":"Re: [PATCH] svnimport add support for parsing From lines for author","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-27T05:34:41Z","receivedAt":"2006-09-27T05:34:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Whitcroft <apw@shadowen.org> writes:\n\n>>> Now that we have support for parsing Signed-off-by: for author\n>>> information it makes sense to handle From: as well.\n>> \n>> I take that you are referring to Sasha's change in ae35b304; I\n>> asked for actual svn users for ACK/NACK but I did not hear any.\n>> Can I understand that you use svnimport for real projects and\n>> are happy with Sasha's change? --- that would be an ack that\n>> would help me sleep better ;-).\n>\n> Heh.  Yeah I am tracking a small SVN repository which is using the\n> kernel DCO.  we have From:/S-o-b: much as akpm uses in -mm.  This was\n> the result of seeing that change and wanting to see if it would pick up\n> our sign-offs.  It only seemed deficient in From: handling :).  It seems\n> to work well in practice for me.\n\nThanks.\n\n>> I also wonder instead of piling up custom flags if it is better\n>> to let match-and-extract pattern be specified from the command\n>> line.\n>\n> I did look at reusing the -S flag, such that -S would be S-o-b: handling\n> and -SS would be S-o-b: and From:, but this script is currently using\n> the old getopt implementation which doesn't record repeats.\n>\n> So you're proposing something more like:\n>\n>     git svn-import -S \"Signed-off-by:\" -S \"From:\" ...\n>\n> Again, we'll have to update the options handling to get that kind of\n> behaviour.  How would you feel about -SS in this context.\n\nIt was more of an idle speculation than a serious proposal.  I\ndo not think there are too many different ways to record the\nauthorship information, so having just two hardwired patterns -F\nand -S would be sufficient.  If there were, then string of -S\noptions that specify the header-looking strings or match\npatterns would have made more sense.\n"},{"id":"27884","messageId":"451BAACE.70005@shadowen.org","threadId":"5690","inReplyTo":"7vfyedj2j2.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] svnimport add support for parsing From lines for author","fromName":"Andy Whitcroft","fromEmail":"apw@shadowen.org","sentAt":"2006-09-28T10:58:22Z","receivedAt":"2006-09-28T10:58:22Z","isPatch":true,"sender":{"key":"apw@shadowen.org","avatar":"https://gravatar.com/avatar/d3088262854661a913ef35cc40fedcc270142d4461791142bc1ea0b2a4e2e147?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Andy Whitcroft <apw@shadowen.org> writes:\n> \n>>>> Now that we have support for parsing Signed-off-by: for author\n>>>> information it makes sense to handle From: as well.\n>>> I take that you are referring to Sasha's change in ae35b304; I\n>>> asked for actual svn users for ACK/NACK but I did not hear any.\n>>> Can I understand that you use svnimport for real projects and\n>>> are happy with Sasha's change? --- that would be an ack that\n>>> would help me sleep better ;-).\n>> Heh.  Yeah I am tracking a small SVN repository which is using the\n>> kernel DCO.  we have From:/S-o-b: much as akpm uses in -mm.  This was\n>> the result of seeing that change and wanting to see if it would pick up\n>> our sign-offs.  It only seemed deficient in From: handling :).  It seems\n>> to work well in practice for me.\n> \n> Thanks.\n> \n>>> I also wonder instead of piling up custom flags if it is better\n>>> to let match-and-extract pattern be specified from the command\n>>> line.\n>> I did look at reusing the -S flag, such that -S would be S-o-b: handling\n>> and -SS would be S-o-b: and From:, but this script is currently using\n>> the old getopt implementation which doesn't record repeats.\n>>\n>> So you're proposing something more like:\n>>\n>>     git svn-import -S \"Signed-off-by:\" -S \"From:\" ...\n>>\n>> Again, we'll have to update the options handling to get that kind of\n>> behaviour.  How would you feel about -SS in this context.\n> \n> It was more of an idle speculation than a serious proposal.  I\n> do not think there are too many different ways to record the\n> authorship information, so having just two hardwired patterns -F\n> and -S would be sufficient.  If there were, then string of -S\n> options that specify the header-looking strings or match\n> patterns would have made more sense.\n\nThis one didn't make it onto the git.git whats next page.  Not sure of\nprotocol in these matters, so I'll just ask.  Has this been rejected or\nforgotten?\n\n:)\n\n-apw\n"},{"id":"27897","messageId":"7vk63ovuom.fsf@assigned-by-dhcp.cox.net","threadId":"5690","inReplyTo":"451BAACE.70005@shadowen.org","subject":"Re: [PATCH] svnimport add support for parsing From lines for author","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-28T16:10:17Z","receivedAt":"2006-09-28T16:10:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Whitcroft <apw@shadowen.org> writes:\n\n> This one didn't make it onto the git.git whats next page.  Not sure of\n> protocol in these matters, so I'll just ask.  Has this been rejected or\n> forgotten?\n\nAsking is always good.  It was forgotten.\n"}]}