threads / patch / 24748

patch, 2 partsgit-svn: fix regex to remove "tail" from svn tags

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

## tl;dr

2 messages between Aug 15, 2010 and Aug 15, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

David D. Kilzer· Aug 15, 2010, 13:15 UTC · lore

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(-)
Show changes to git-svn.perl +1 −1
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· Aug 15, 2010, 23:48 UTC · re: David D. Kilzer · lore

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

"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

← back to recent threads