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

[PATCH] git svn: find-rev allows short switches for near matches

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 7, 2014, 08:35 UTC
Message-ID
<20140907083519.GA11302@dcvr.yhbt.net>

Allow -B and -A to act as short aliases for --before and --after options respectively. This reduces typing and hopefully allows reuse of muscle memory for grep(1) users.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 Will push to git://bogomips.org/git-svn.git
 Documentation/git-svn.txt | 2 ++
 git-svn.perl              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 14036cf..ef8ef1c 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -386,11 +386,13 @@ Any other arguments are passed directly to 'git log'
 	tree-ish to specify which branch should be searched).  When given a
 	tree-ish, returns the corresponding SVN revision number.
 +
+-B;;
 --before;;
 	Don't require an exact match if given an SVN revision, instead find
 	the commit corresponding to the state of the SVN repository (on the
 	current branch) at the specified revision.
 +
+-A;;
 --after;;
 	Don't require an exact match if given an SVN revision; if there is
 	not an exact match return the closest match searching forward in the
diff --git a/git-svn.perl b/git-svn.perl
index 47cd6ea..a0ca31d 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -260,8 +260,8 @@ my %cmd = (
 			} ],
 	'find-rev' => [ \&cmd_find_rev,
 	                "Translate between SVN revision numbers and tree-ish",
-			{ 'before' => \$_before,
-			  'after' => \$_after } ],
+			{ 'B|before' => \$_before,
+			  'A|after' => \$_after } ],
 	'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
 			{ 'merge|m|M' => \$_merge,
 			  'verbose|v' => \$_verbose,
-- 
EW
Message 1 of 1 in “git svn: find-rev allows short switches for near matches”
  1. git svn: find-rev allows short switches for near matchesEric Wong, Sep 7, 2014

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.