{"thread":{"id":"38386","subject":"[PATCH] contacts: introduce --since and --min-percent","startedAt":"2015-01-16T20:58:53Z","lastAt":"2015-01-21T17:09:09Z","messageCount":4,"participants":["Ramkumar Ramachandra","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"254840","messageId":"1421441933-54183-1-git-send-email-artagnon@gmail.com","threadId":"38386","inReplyTo":null,"subject":"[PATCH] contacts: introduce --since and --min-percent","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-16T20:58:53Z","receivedAt":"2015-01-16T20:58:53Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n contrib/contacts/git-contacts | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts\nindex dbe2abf..b06f2e1 100755\n--- a/contrib/contacts/git-contacts\n+++ b/contrib/contacts/git-contacts\n@@ -8,12 +8,16 @@\n use strict;\n use warnings;\n use IPC::Open2;\n+use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n \n my $since = '5-years-ago';\n my $min_percent = 10;\n my $labels_rx = qr/Signed-off-by|Reviewed-by|Acked-by|Cc/i;\n my %seen;\n \n+my $rv = GetOptions('since=s' => \\$since, 'min-percent=i' => \\$min_percent);\n+exit 1 if (!$rv);\n+\n sub format_contact {\n \tmy ($name, $email) = @_;\n \treturn \"$name <$email>\";\n-- \n2.2.1\n"},{"id":"254841","messageId":"CAPig+cS5is73damiYgCmWp3QzmBX+E38f26oyn2nwG0FO2AStQ@mail.gmail.com","threadId":"38386","inReplyTo":"1421441933-54183-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] contacts: introduce --since and --min-percent","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-01-16T21:11:51Z","receivedAt":"2015-01-16T21:11:51Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jan 16, 2015 at 3:58 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n> diff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts\n> index dbe2abf..b06f2e1 100755\n> --- a/contrib/contacts/git-contacts\n> +++ b/contrib/contacts/git-contacts\n> @@ -8,12 +8,16 @@\n>  use strict;\n>  use warnings;\n>  use IPC::Open2;\n> +use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n\nMost of the rest of the codebase uses qw(...) rather than qw/.../.\n\n>  my $since = '5-years-ago';\n>  my $min_percent = 10;\n>  my $labels_rx = qr/Signed-off-by|Reviewed-by|Acked-by|Cc/i;\n>  my %seen;\n>\n> +my $rv = GetOptions('since=s' => \\$since, 'min-percent=i' => \\$min_percent);\n> +exit 1 if (!$rv);\n\nThis would make more sense if moved down to the point where the script\narguments are processed (just before the 'if (!@ARGV)' line, for\ninstance).\n\nThese new options should be documented in git-contacts.txt. Also, the\n\"Limitations\" section of the documentation says that these values are\ncurrently hard-coded, so it deserves an update as well.\n\n>  sub format_contact {\n>         my ($name, $email) = @_;\n>         return \"$name <$email>\";\n> --\n> 2.2.1\n"},{"id":"254842","messageId":"1421443439-54809-1-git-send-email-artagnon@gmail.com","threadId":"38386","inReplyTo":"1421441933-54183-1-git-send-email-artagnon@gmail.com","subject":"[PATCH v2] contacts: introduce --since and --min-percent","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-16T21:23:59Z","receivedAt":"2015-01-16T21:23:59Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n contrib/contacts/git-contacts     |  4 ++++\n contrib/contacts/git-contacts.txt | 16 ++++++++++++----\n 2 files changed, 16 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts\nindex dbe2abf..5dde920 100755\n--- a/contrib/contacts/git-contacts\n+++ b/contrib/contacts/git-contacts\n@@ -8,6 +8,7 @@\n use strict;\n use warnings;\n use IPC::Open2;\n+use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);\n \n my $since = '5-years-ago';\n my $min_percent = 10;\n@@ -158,6 +159,9 @@ sub mailmap_contacts {\n \treturn \\%mapped;\n }\n \n+my $rv = GetOptions('since=s' => \\$since, 'min-percent=i' => \\$min_percent);\n+exit 1 if (!$rv);\n+\n if (!@ARGV) {\n \tdie \"No input revisions or patch files\\n\";\n }\ndiff --git a/contrib/contacts/git-contacts.txt b/contrib/contacts/git-contacts.txt\nindex dd914d1..a50c97f 100644\n--- a/contrib/contacts/git-contacts.txt\n+++ b/contrib/contacts/git-contacts.txt\n@@ -31,6 +31,16 @@ discuss proposed changes, or for finding the list of recipients to Cc: when\n submitting a patch series via `git send-email`. For the latter case, `git\n contacts` can be used as the argument to `git send-email`'s `--cc-cmd` option.\n \n+OPTIONS\n+-------\n+\n+--min-percent::\n+\tThe minimum threshold of blame percentage that a person must\n+\texceed in order to be reported.\n+\n+--since::\n+        Depth of history to dig.\n+\n \n DISCUSSION\n ----------\n@@ -83,10 +93,8 @@ $ git send-email --cc-cmd='git contacts' feature/*.patch\n LIMITATIONS\n -----------\n \n-Several conditions controlling a person's significance are currently\n-hard-coded, such as minimum participation level (10%), blame date-limiting (5\n-years), and `-C` level for detecting moved and copied lines (a single `-C`). In\n-the future, these conditions may become configurable.\n+The `-C` level for detecting moved and copied lines (a single `-C`) is\n+hard-coded. In the future, this may become configurable.\n \n \n GIT\n-- \n2.2.1\n"},{"id":"254995","messageId":"CALkWK0kE4AOgwN7+U5tqH8PLioMy6yXrcH-XiEpDEDZ4RfT4CQ@mail.gmail.com","threadId":"38386","inReplyTo":"1421443439-54809-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2] contacts: introduce --since and --min-percent","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-21T17:09:09Z","receivedAt":"2015-01-21T17:09:09Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n\nJunio: this isn't in the latest rebuild of pu; I wonder if you've\nforgotten to pick it up.\n"}]}