[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