{"thread":{"id":"24660","subject":"[BUG/TEST] git-svn: fetch fails with deleted tag","startedAt":"2010-08-07T05:36:55Z","lastAt":"2010-08-12T08:11:57Z","messageCount":3,"participants":["David D. Kilzer","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"147376","messageId":"1281159415-60900-1-git-send-email-ddkilzer@kilzer.net","threadId":"24660","inReplyTo":null,"subject":"[BUG/TEST] git-svn: fetch fails with deleted tag","fromName":"David D. Kilzer","fromEmail":"ddkilzer@kilzer.net","sentAt":"2010-08-07T05:36:55Z","receivedAt":"2010-08-07T05:36:55Z","isPatch":false,"sender":{"key":"ddkilzer@kilzer.net","avatar":"https://avatars.githubusercontent.com/u/263571?v=4"},"body":"The attached test fails when fetching the svn repo:\n\n    Checksum mismatch: ChangeLog 065854....\n    expected: ce771b....\n         got: 9563fd....\n\nThe issue seems to be that the tag was created, deleted and then\nrecreated from the same source revision but at different paths.\n\nAny suggestions for how to work around or fix this would be\ngreatly appreciated.\n\nIronically, I made the original commits in the svn repo that I'm\ntrying to fetch.  And yes, the extra \"trunk\" directory on the\nbranch was intended--it's the style that was agreed upon at the\ntime.\n\nSigned-off-by: David D. Kilzer <ddkilzer@kilzer.net>\n---\n t/t9199-git-svn-deleted-tag.sh |   40 ++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 40 insertions(+), 0 deletions(-)\n create mode 100755 t/t9199-git-svn-deleted-tag.sh\n\ndiff --git a/t/t9199-git-svn-deleted-tag.sh b/t/t9199-git-svn-deleted-tag.sh\nnew file mode 100755\nindex 0000000..059cccd\n--- /dev/null\n+++ b/t/t9199-git-svn-deleted-tag.sh\n@@ -0,0 +1,40 @@\n+#!/bin/sh\n+\n+test_description='git svn fetch with deleted tag'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'setup svn repo' '\n+\tmkdir -p import/trunk/SubDir &&\n+\tmkdir -p import/branches &&\n+\tmkdir -p import/tags &&\n+\techo \"base\" > import/trunk/SubDir/ChangeLog &&\n+\tsvn_cmd import -m \"import for git svn\" import \"$svnrepo\" &&\n+\trm -rf import &&\n+\n+\tsvn_cmd mkdir --parents -m \"create MyBranch directory\" \"$svnrepo/branches/MyBranch\" &&\n+\tsvn_cmd cp -m \"create branch MyBranch\" \"$svnrepo/trunk\" \"$svnrepo/branches/MyBranch/trunk\" &&\n+\n+\tsvn_cmd co \"$svnrepo/trunk\" svn_project &&\n+\tcd svn_project &&\n+\n+\techo \"trunk change\" >> SubDir/ChangeLog &&\n+\tsvn_cmd ci -m \"trunk change\" SubDir/ChangeLog &&\n+\n+\tsvn_cmd switch \"$svnrepo/branches/MyBranch/trunk\" &&\n+\techo \"branch change\" >> SubDir/ChangeLog &&\n+\tsvn_cmd ci -m \"branch change\" SubDir/ChangeLog &&\n+\n+\tcd .. &&\n+\tsvn_cmd cp -m \"create MyTag attempt 1\" -r5 \"$svnrepo/trunk/SubDir\" \"$svnrepo/tags/MyTag\" &&\n+\tsvn_cmd rm -m \"delete MyTag attempt 1\" \"$svnrepo/tags/MyTag\" &&\n+\tsvn_cmd cp -m \"create MyTag attempt 2\" -r5 \"$svnrepo/branches/MyBranch/trunk/SubDir\" \"$svnrepo/tags/MyTag\"\n+'\n+\n+test_expect_success 'fetch with deleted tag' '\n+\tgit svn init --stdlayout \"$svnrepo\" git_project &&\n+\tcd git_project &&\n+\tgit svn fetch\n+'\n+\n+test_done\n-- \n1.7.2.1.49.g98551\n"},{"id":"147868","messageId":"765385.99383.qm@web30004.mail.mud.yahoo.com","threadId":"24660","inReplyTo":"1281159415-60900-1-git-send-email-ddkilzer@kilzer.net","subject":"Re: [BUG/TEST] git-svn: fetch fails with deleted tag","fromName":"David D. Kilzer","fromEmail":"ddkilzer@kilzer.net","sentAt":"2010-08-12T05:18:39Z","receivedAt":"2010-08-12T05:18:39Z","isPatch":false,"sender":{"key":"ddkilzer@kilzer.net","avatar":"https://avatars.githubusercontent.com/u/263571?v=4"},"body":"On Fri, August 6, 2010 at 10:36:55 PM, David D. Kilzer wrote:\n\n> The attached test fails when fetching the svn repo:\n> \n>      Checksum mismatch: ChangeLog 065854....\n>     expected:  ce771b....\n>          got: 9563fd....\n> \n> The issue  seems to be that the tag was created, deleted and then\n> recreated from the  same source revision but at different paths.\n\n\nI have a fix for this.  I hope to send it out by Friday for further review.\n\nThis bug affects svn tags that are created, deleted and recreated with the \nfollowing criteria:\n\n- Both tags have the same name (since the second one replaces the first one \nafter it's deleted).\n- Both tags were created from the same revision in the repository.\n- Each tag used a different repository path, e.g., one was from trunk while the \nother was from a branch.\n- [Optional] Both tags had a file with the same path name but different content.\n\nIf the optional fourth criteria is met, the checksum mismatch occurs and git-svn \nfails during import.\n\nHowever, if only the first three criteria are met, git-svn actually creates a \ntag with the first (deleted) tag's content!  The second tag's content is never \nimported, leaving the user with a tag in git whose content doesn't match the \nlatest tag in svn.\n\nDave\n"},{"id":"147880","messageId":"20100812081157.GA30970@dcvr.yhbt.net","threadId":"24660","inReplyTo":"765385.99383.qm@web30004.mail.mud.yahoo.com","subject":"Re: [BUG/TEST] git-svn: fetch fails with deleted tag","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-08-12T08:11:57Z","receivedAt":"2010-08-12T08:11:57Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"\"David D. Kilzer\" <ddkilzer@kilzer.net> wrote:\n> On Fri, August 6, 2010 at 10:36:55 PM, David D. Kilzer wrote:\n> > The attached test fails when fetching the svn repo:\n> I have a fix for this.  I hope to send it out by Friday for further review.\n\nThanks for the update, David.  I took a short stab but didn't\ncome up with much.  I'll take a look at your patch this weekend\n\n-- \nEric Wong\n"}]}