{"thread":{"id":"9818","subject":"[RFC] svnimport/cvsimport: force creation of tags that already exist.","startedAt":"2007-09-07T15:42:22Z","lastAt":"2007-09-07T21:35:07Z","messageCount":3,"participants":["Michael Smith","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"52917","messageId":"Pine.LNX.4.64.0709071125090.6203@juice.ott.cti.com","threadId":"9818","inReplyTo":null,"subject":"[RFC] svnimport/cvsimport: force creation of tags that already exist.","fromName":"Michael Smith","fromEmail":"msmith@cbnco.com","sentAt":"2007-09-07T15:42:22Z","receivedAt":"2007-09-07T15:42:22Z","isPatch":false,"sender":{"key":"msmith@cbnco.com","avatar":null},"body":"Hi all,\n\ngit-svnimport was changed recently to use git-tag to make tags (47ee8ed2). \nI've had to add the \"-f\" option to import a repository where a tag was \nmoved. I think git-cvsimport would have the same problem.\n\nI understand moving tags is frowned upon in Git. I don't know how common \nthe practise is in Subversion and CVS, or whether it makes sense to \nmake the import scripts force tag creation by default.\n\nMike\n\n---\n git-cvsimport.perl |    2 +-\n git-svnimport.perl |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex ba23eb8..2954fb8 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -779,7 +779,7 @@ sub commit {\n \t\t$xtag =~ tr/_/\\./ if ( $opt_u );\n \t\t$xtag =~ s/[\\/]/$opt_s/g;\n \n-\t\tsystem('git-tag', $xtag, $cid) == 0\n+\t\tsystem('git-tag', '-f', $xtag, $cid) == 0\n \t\t\tor die \"Cannot create tag $xtag: $!\\n\";\n \n \t\tprint \"Created tag '$xtag' on '$branch'\\n\" if $opt_v;\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 8c17fb5..d3ad5b9 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -873,7 +873,7 @@ sub commit {\n \n \t\t$dest =~ tr/_/\\./ if $opt_u;\n \n-\t\tsystem('git-tag', $dest, $cid) == 0\n+\t\tsystem('git-tag', '-f', $dest, $cid) == 0\n \t\t\tor die \"Cannot create tag $dest: $!\\n\";\n \n \t\tprint \"Created tag '$dest' on '$branch'\\n\" if $opt_v;\n-- \n1.5.2.1\n"},{"id":"52944","messageId":"7vzlzy2o46.fsf@gitster.siamese.dyndns.org","threadId":"9818","inReplyTo":"Pine.LNX.4.64.0709071125090.6203@juice.ott.cti.com","subject":"Re: [RFC] svnimport/cvsimport: force creation of tags that already exist.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-07T20:54:01Z","receivedAt":"2007-09-07T20:54:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Smith <msmith@cbnco.com> writes:\n\n> I understand moving tags is frowned upon in Git. I don't know how common \n> the practise is in Subversion and CVS, or whether it makes sense to \n> make the import scripts force tag creation by default.\n\nI think the patch itself makes sense.  If for some reason the\nimporter detects that the CVS or SVN history moved a tag, we\neither:\n\n    (1) have a way to keep track of the versions of the tag; or\n    (2) allow it and make it \"last one wins\" semantics; or\n    (3) ignore it and make it \"first one wins\" semantics.  \n\nErroring out complaining that the tag cannot be created, as the\ncurrent code does, does not make any sense.\n\nThe patch needs to be accompanied with a better commit log\ndescription.  I am guessing that with your change the semantics\nwould become (2) above (assuming that cvsps or whoever reads the\nhistory of the other side gives events in chronological order),\nbut you should not force readers of your commit log message to\nguess.\n"},{"id":"52950","messageId":"Pine.LNX.4.64.0709071733500.6203@juice.ott.cti.com","threadId":"9818","inReplyTo":"7vzlzy2o46.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] (cvs|svn)import: Ask git-tag to overwrite old tags.","fromName":"Michael Smith","fromEmail":"msmith@cbnco.com","sentAt":"2007-09-07T21:35:07Z","receivedAt":"2007-09-07T21:35:07Z","isPatch":true,"sender":{"key":"msmith@cbnco.com","avatar":null},"body":"If the tag was moved in CVS or SVN history, it will be moved in the\nimported history as well. Tag history is not tracked.\n---\n git-cvsimport.perl |    2 +-\n git-svnimport.perl |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex ba23eb8..2954fb8 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -779,7 +779,7 @@ sub commit {\n \t\t$xtag =~ tr/_/\\./ if ( $opt_u );\n \t\t$xtag =~ s/[\\/]/$opt_s/g;\n \n-\t\tsystem('git-tag', $xtag, $cid) == 0\n+\t\tsystem('git-tag', '-f', $xtag, $cid) == 0\n \t\t\tor die \"Cannot create tag $xtag: $!\\n\";\n \n \t\tprint \"Created tag '$xtag' on '$branch'\\n\" if $opt_v;\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 8c17fb5..d3ad5b9 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -873,7 +873,7 @@ sub commit {\n \n \t\t$dest =~ tr/_/\\./ if $opt_u;\n \n-\t\tsystem('git-tag', $dest, $cid) == 0\n+\t\tsystem('git-tag', '-f', $dest, $cid) == 0\n \t\t\tor die \"Cannot create tag $dest: $!\\n\";\n \n \t\tprint \"Created tag '$dest' on '$branch'\\n\" if $opt_v;\n-- \n1.5.3.1.20.gb860\n"}]}