{"thread":{"id":"28090","subject":"[PATCH/RFC] git-svn: remove auto_abbrev (Getopt::Long option)","startedAt":"2011-08-13T20:33:32Z","lastAt":"2011-08-17T01:02:10Z","messageCount":2,"participants":["Piotr Krukowiecki","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"173463","messageId":"4E46DF9C.8040900@gmail.com","threadId":"28090","inReplyTo":null,"subject":"[PATCH/RFC] git-svn: remove auto_abbrev (Getopt::Long option)","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-08-13T20:33:32Z","receivedAt":"2011-08-13T20:33:32Z","isPatch":true,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"\nRFC because this changes user interface (no option abbreviation),\nbut I know no other good way to fix the --author problem.\n\nThe --author option would be useful, because I usually use\n  git svn log --oneline\nand paste the changes with svn revision numbers to bugzilla etc.\n\nAll tests pass with this change.\n\n--------8<--------\nFrom: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>\nDate: Sat, 13 Aug 2011 21:00:56 +0200\nSubject: [PATCH] git-svn: remove auto_abbrev (Getopt::Long option)\n\nauto_abbrev allows to specify shortest unique option prefix.\nFor example '--authors-file' can be written also as '--author'\ngiven there is no other option which begins with '--author'.\n\n'git-svn log' passes all unrecognized options to 'git log'. It should\nalso pass '--author' but due to auto_abbrev it recognizes it as\n'--authors-file'. In result it's not possible to use this option.\n\nFix this by removing auto_abbrev. No other perl script seems to use it,\nalso other git commands seems to have no option abbreviation feature.\nThe side effect is that you can not abbreviate options to git-svn, obviously.\n\nIn fact only log and blame requires no option abbreviation, because only they\nuse pass_through option (pass unrecognized options), but I think it would not\nbe natural if some git-svn commands had options abbreviations and some didn't.\n\nAlternative would be to handle all conflicting blame/log options, but\nmaintaing it would be a nightmare...\n\nSigned-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>\n---\n git-svn.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 89f83fd..3e2e276 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -56,7 +56,7 @@ use File::Basename qw/dirname basename/;\n use File::Path qw/mkpath/;\n use File::Spec;\n use File::Find;\n-use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n+use Getopt::Long qw/:config gnu_getopt no_ignore_case/;\n use IPC::Open3;\n use Git;\n use Memoize;  # core since 5.8.0, Jul 2002\n-- \n1.7.6.GIT\n\n-- \nPiotr Krukowiecki\n"},{"id":"173652","messageId":"20110817010210.GA1189@dcvr.yhbt.net","threadId":"28090","inReplyTo":"4E46DF9C.8040900@gmail.com","subject":"Re: [PATCH/RFC] git-svn: remove auto_abbrev (Getopt::Long option)","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2011-08-17T01:02:10Z","receivedAt":"2011-08-17T01:02:10Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Piotr Krukowiecki <piotr.krukowiecki@gmail.com> wrote:\n> RFC because this changes user interface (no option abbreviation),\n> but I know no other good way to fix the --author problem.\n> \n> The --author option would be useful, because I usually use\n>   git svn log --oneline\n> and paste the changes with svn revision numbers to bugzilla etc.\n> \n> All tests pass with this change.\n\nHow about minimizing the impact and potential breakage with this?\n\n(I'm not sure if \"blame\" benefits/hurts from this, I almost never\nuse any form of it)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 96f373f..ba382eb 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -298,6 +298,9 @@ my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);\n read_git_config(\\%opts);\n if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {\n \tGetopt::Long::Configure('pass_through');\n+\tif ($cmd eq 'log') {\n+\t\tGetopt::Long::Configure('no_auto_abbrev');\n+\t}\n }\n my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n                     'minimize-connections' => \\$Git::SVN::Migration::_minimize,\n-- \nEric Wong\n"}]}