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

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

From
David D. Kilzer <ddkilzer@kilzer.net>
Date
Aug 15, 2010, 13:15 UTC
Message-ID
<1281878155-61937-1-git-send-email-ddkilzer@kilzer.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
Next: Eric Wong
Message 1 of 2 in “git-svn: fix regex to remove "tail" from svn tags”
  1. 1/2 git-svn: fix regex to remove "tail" from svn tagsDavid D. Kilzer, Aug 15, 2010
  2. Eric WongAug 15, 2010

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.