git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] git-svn: remove auto_abbrev (Getopt::Long option)

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
Aug 13, 2011, 20:33 UTC
Message-ID
<4E46DF9C.8040900@gmail.com>

RFC because this changes user interface (no option abbreviation), but I know no other good way to fix the --author problem.

The --author option would be useful, because I usually use
  git svn log --oneline
and paste the changes with svn revision numbers to bugzilla etc.
All tests pass with this change.
--------8<--------
From: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date: Sat, 13 Aug 2011 21:00:56 +0200
Subject: [PATCH] git-svn: remove auto_abbrev (Getopt::Long option)

auto_abbrev allows to specify shortest unique option prefix. For example '--authors-file' can be written also as '--author' given there is no other option which begins with '--author'.

'git-svn log' passes all unrecognized options to 'git log'. It should also pass '--author' but due to auto_abbrev it recognizes it as '--authors-file'. In result it's not possible to use this option.

Fix this by removing auto_abbrev. No other perl script seems to use it, also other git commands seems to have no option abbreviation feature. The side effect is that you can not abbreviate options to git-svn, obviously.

In fact only log and blame requires no option abbreviation, because only they use pass_through option (pass unrecognized options), but I think it would not be natural if some git-svn commands had options abbreviations and some didn't.

Alternative would be to handle all conflicting blame/log options, but maintaing it would be a nightmare...

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 89f83fd..3e2e276 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -56,7 +56,7 @@ use File::Basename qw/dirname basename/;
 use File::Path qw/mkpath/;
 use File::Spec;
 use File::Find;
-use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
+use Getopt::Long qw/:config gnu_getopt no_ignore_case/;
 use IPC::Open3;
 use Git;
 use Memoize;  # core since 5.8.0, Jul 2002
-- 
1.7.6.GIT

-- 
Piotr Krukowiecki
Next: Eric Wong
Message 1 of 2 in “git-svn: remove auto_abbrev (Getopt::Long option)”
  1. git-svn: remove auto_abbrev (Getopt::Long option)Piotr Krukowiecki, Aug 13, 2011
  2. Eric WongAug 17, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.