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

[PATCH] git-cvsimport: strip question-mark characters in tags

From
Ed Santiago <santiago@redhat.com>
Date
Apr 14, 2010, 13:38 UTC
Message-ID
<20100414133831.GA12135@f.santiago.vpn.redhat.com>

Question mark character appears to be valid in a CVS tag, but not a git one. Remove it. Leave open the possibility that there may be more such characters; and comment (FIXME) that we may want to replace those instead of removing them.

Also: if git tag command fails, do not include $! in our
error message: it is not useful after system(), and will
only serve as a red herring.
---
 git-cvsimport.perl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 9e03eee..48de2b4 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -840,10 +840,12 @@ sub commit {
 		$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
 		$xtag =~ tr/_/\./ if ( $opt_u );
 		$xtag =~ s/[\/]/$opt_s/g;
-		$xtag =~ s/\[//g;
+		# The following characters are valid in CVS tags but not git.
+		# Remove them. (FIXME: optionally replace?)
+		$xtag =~ tr/\[\?//d;
 
 		system('git' , 'tag', '-f', $xtag, $cid) == 0
-			or die "Cannot create tag $xtag: $!\n";
+			or die "Cannot create tag $xtag\n";
 
 		print "Created tag '$xtag' on '$branch'\n" if $opt_v;
 	}
-- 
1.6.6.1


-- 
Ed Santiago             Software Engineer             santiago@redhat.com
Next: Junio C Hamano
Message 1 of 7 in “git-cvsimport: strip question-mark characters in tags”
  1. git-cvsimport: strip question-mark characters in tagsEd Santiago, Apr 14, 2010
  2. Junio C HamanoApr 14, 2010
  3. Ed SantiagoApr 14, 2010
  4. Junio C HamanoApr 14, 2010
  5. Andreas SchwabApr 14, 2010
  6. Ed SantiagoApr 14, 2010
  7. Johan HerlandApr 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.