# [PATCH 1/2] git-svn: fix regex to remove "tail" from svn tags

2 messages from 2010-08-15 to 2010-08-15. Participants: David D. Kilzer, Eric Wong.
Thread: https://gitlist.dev/t/24748

## David D. Kilzer, 2010-08-15 13:15

Subject: [PATCH 1/2] git-svn: fix regex to remove "tail" from svn tags
Message-ID: <1281878155-61937-1-git-send-email-ddkilzer@kilzer.net>
URL: https://gitlist.dev/e/1281878155-61937-1-git-send-email-ddkilzer%40kilzer.net

```
Fix a regular expression used to remove the revision from the
end of an svn tag or branch name.  The regex did not account for
any "tail" (dashes) that may have been added to the end of the
tag name (which first appeared in v1.4.1-rc2~11).  If not fixed,
tags with names like "tags/mytag@5--@2" may be created.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 34884b8..39bcb45 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2959,7 +2959,7 @@ sub other_gs {
 	my $gs = Git::SVN->find_by_url($new_url, $url, $branch_from);
 	unless ($gs) {
 		my $ref_id = $old_ref_id;
-		$ref_id =~ s/\@\d+$//;
+		$ref_id =~ s/\@\d+-*$//;
 		$ref_id .= "\@$r";
 		# just grow a tail if we're not unique enough :x
 		$ref_id .= '-' while find_ref($ref_id);
-- 
1.7.2.1.49.g98551

```

## Eric Wong, 2010-08-15 23:48

Subject: Re: [PATCH 1/2] git-svn: fix regex to remove "tail" from svn tags
Message-ID: <20100815234833.GA4359@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20100815234833.GA4359%40dcvr.yhbt.net
In-Reply-To: <1281878155-61937-1-git-send-email-ddkilzer@kilzer.net>

```
"David D. Kilzer" <ddkilzer@kilzer.net> wrote:
> Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>

Thank you David,

I've acked and pushed out both patches to git://git.bogomips.org/git-svn
for Junio

David D. Kilzer (2):
      git-svn: fix regex to remove "tail" from svn tags
      git-svn: fix fetch with deleted tag

-- 
Eric Wong

```
