{"thread":{"id":"2258","subject":"[PATCH] Change git-cvsimport to handle slashes in CVS tags","startedAt":"2005-10-28T18:46:45Z","lastAt":"2005-10-28T20:47:38Z","messageCount":5,"participants":["Wayne Scott","Johannes Schindelin","Linus Torvalds","Junio C Hamano","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10762","messageId":"59a6e5830510281146s7b25da76l8bf97287522b89f2@mail.gmail.com","threadId":"2258","inReplyTo":null,"subject":"[PATCH] Change git-cvsimport to handle slashes in CVS tags","fromName":"Wayne Scott","fromEmail":"wsc9tt@gmail.com","sentAt":"2005-10-28T18:46:45Z","receivedAt":"2005-10-28T18:46:45Z","isPatch":true,"sender":{"key":"wsc9tt@gmail.com","avatar":"https://gravatar.com/avatar/2418bf5fa7f1625a2b9dd049db4ab56110f561610421d6f2559f7c018ce53eb3?d=mp&s=160"},"body":"The Tcl/Tk CVS tree contains some tags like this one:\n  dev-stubs-merge-8-1-3/9/99\n\nCVS doesn't mind that tag, but git can't handle the slash\ncharacters in the tag.  Just change those to underscore\nso imports can complete.\n\nSigned-off-by: Wayne Scott <wsc9tt@gmail.com>\n---\n\n git-cvsimport.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\napplies-to: cf6439199f61d87dbb70fd7b43144e41462a359d\n225c95454711467fc889c15cb3f7ca3230fce58d\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex bbb83fb..d71c30c 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -636,6 +636,7 @@ my $commit = sub {\n                my($xtag) = $tag;\n                $xtag =~ s/\\s+\\*\\*.*$//; # Remove stuff like ** INVALID ** and *\n* FUNKY **\n                $xtag =~ tr/_/\\./ if ( $opt_u );\n+               $xtag =~ tr/\\//_/;\n\n                my $pid = open2($in, $out, 'git-mktag');\n                print $out \"object $cid\\n\".\n---\n0.99.8.GIT\n"},{"id":"10763","messageId":"Pine.LNX.4.63.0510282058120.13531@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2258","inReplyTo":"59a6e5830510281146s7b25da76l8bf97287522b89f2@mail.gmail.com","subject":"Re: [PATCH] Change git-cvsimport to handle slashes in CVS tags","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-28T18:58:24Z","receivedAt":"2005-10-28T18:58:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nhttp://www.gelato.unsw.edu.au/archives/git/0508/7825.html\n\nCiao,\nDscho\n"},{"id":"10764","messageId":"Pine.LNX.4.64.0510281151450.4664@g5.osdl.org","threadId":"2258","inReplyTo":"59a6e5830510281146s7b25da76l8bf97287522b89f2@mail.gmail.com","subject":"Re: [PATCH] Change git-cvsimport to handle slashes in CVS tags","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-10-28T19:10:30Z","receivedAt":"2005-10-28T19:10:30Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nHmm.. git can certainly handle slashes in tags, but you'd need to \nbasically \"mkdir\" the path up to there before creating them. \n\nThat's probably not the right thing to do for a tag that comes from the \noutside, since in git, the slashes work like in a filesystem, and should \nimply grouping (ie you might have a family of tags that is named by \nusage, and be called something like \"release/xyz\" or whatever).\n\nIs \"_\" the right thing to replace it with, though? To me, \"_\" replaces \neither a space or a dash, while a slash could be replaced by something \nmore like a special character.\n\nMaybe it's just me, but your example \"dev-stubs-merge-8-1-3/9/99\" might\nlook nicer either of these ways:\n\n - dev-stubs-merge-8-1-3|9|99 (but \"|\" is hard to use with shell)\n - dev-stubs-merge-8-1-3.9.99 (CVS tags can't contain '.', right?)\n - dev-stubs-merge-8-1-3:9:99 (confuse with time?)\n - dev-stubs-merge-8-1-3+9+99 (one arithmetic op replaced by another)\n - dev-stubs-merge-8-1-3#9#99 (that's pretty ugly)\n - dev-stubs-merge-8-1-3?9?99 (Wayne might be right after all)\n - dev-stubs-merge-8-1-3_9_99 (maybe Wayne _is_ right?)\n\nI dunno. But maybe we do want the option of just keeping it as a slash, \nand teach git-cvsimport to create the proper subdirectory prefixes.\n\nI have no idea how to do that in perl, though. Right now it just does\n\n\topen(C,\">$git_dir/refs/tags/$xtag\")\n\nhow would you do \"create file with all path components\"?\n\n\t\tLinus\n"},{"id":"10766","messageId":"7vmzkt4c7s.fsf@assigned-by-dhcp.cox.net","threadId":"2258","inReplyTo":"Pine.LNX.4.64.0510281151450.4664@g5.osdl.org","subject":"Re: [PATCH] Change git-cvsimport to handle slashes in CVS tags","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-28T20:29:27Z","receivedAt":"2005-10-28T20:29:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> I dunno. But maybe we do want the option of just keeping it as a slash, \n> and teach git-cvsimport to create the proper subdirectory prefixes.\n\nHow about doing both?\n\nI think patch by Johannes to allow replacing slash to arbitrary\nstring is a reasonable thing to have, but somebody who uses\ncvsimport needs to sign that off for me -- I do not regularly\nuse git-ANYimport myself.\n\n> I have no idea how to do that in perl, though. Right now it just does\n>\n> \topen(C,\">$git_dir/refs/tags/$xtag\")\n>\n> how would you do \"create file with all path components\"?\n\nSomething like this? \n\nuse File::Path;\nmy $file = \"$git_dir/refs/tags/$xtag\";\nmy ($dir) =  $file =~ m/(.*)\\//;\nmkpath($dir) && open C, \">$file\";\n"},{"id":"10767","messageId":"43628E6A.7000104@zytor.com","threadId":"2258","inReplyTo":"Pine.LNX.4.64.0510281151450.4664@g5.osdl.org","subject":"Re: [PATCH] Change git-cvsimport to handle slashes in CVS tags","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-28T20:47:38Z","receivedAt":"2005-10-28T20:47:38Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Linus Torvalds wrote:\n> \n> Is \"_\" the right thing to replace it with, though? To me, \"_\" replaces \n> either a space or a dash, while a slash could be replaced by something \n> more like a special character.\n> \n\nIf nothing else it creates a nice symmetry, since CVS can't use '.' in \ntags (which only is the most common character in nearly all versioning \nschemes), and which is commonly replaced by '_'.  We already have the -m \noption to change that back to dots, so we'd go:\n\n'/' -> '_' -> '.'\n\n... which at least means no info loss.\n\n\t-hpa\n"}]}