{"thread":{"id":"40979","subject":"What's \"wrong\" with this fast-import?","startedAt":"2015-12-12T19:25:40Z","lastAt":"2015-12-14T16:20:38Z","messageCount":3,"participants":["com.git-scm@io7m.com","SZEDER Gábor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"274319","messageId":"20151212192540.4ba49fea@viper.int.arc7.info","threadId":"40979","inReplyTo":null,"subject":"What's \"wrong\" with this fast-import?","fromName":"","fromEmail":"com.git-scm@io7m.com","sentAt":"2015-12-12T19:25:40Z","receivedAt":"2015-12-12T19:25:40Z","isPatch":false,"sender":{"key":"com.git-scm@io7m.com","avatar":null},"body":"Hello!\n\nI'm trying to track down an issue with the Fossil SCM, specifically the\nexport feature that can produce the fast-import files consumed by Git.\n\nThe symptom of the bug seems to be that if a branch B is created from\nbranch A, files committed to B, and then B merged with A, the committed\nfiles are not present in the head of A.\n\nAs an example:\n\n  http://waste.io7m.com/2015/12/12/fossilexport/\n\nThe given test.fossil repository was populated with the following steps:\n\n  1. Create fossil repository.\n  2. Add README.txt and commit in trunk.\n  3. Create branch 'b0' and switch to it.\n  4. Add README-b0.txt and commit in b0.\n  5. Switch to trunk.\n  6. Merge and commit 'b0'.\n\nThe HEAD of the fossil repository now contains README.txt and\nREADME-b0.txt.\n\nExporting the repository (see test.export) produces:\n\n--\nblob\nmark :4\ndata 7\nHello.\n\nblob\nmark :10\ndata 10\nHello b0.\n\ncommit refs/heads/trunk\nmark :3\ncommitter someone <someone> 1449930286 +0000\ndata 22\ninitial empty check-in\ndeleteall\n\ncommit refs/heads/trunk\nmark :7\ncommitter someone <someone> 1449930317 +0000\ndata 7\nInitial\nfrom :3\nM 100644 :4 README.txt\n\ncommit refs/heads/b0\nmark :9\ncommitter someone <someone> 1449930338 +0000\ndata 28\nCreate new branch named \"b0\"\nfrom :7\n\ncommit refs/heads/b0\nmark :13\ncommitter someone <someone> 1449930374 +0000\ndata 13\nAdd README-b0\nfrom :9\nM 100644 :10 README-b0.txt\n\ncommit refs/heads/trunk\nmark :15\ncommitter someone <someone> 1449930396 +0000\ndata 8\nMerge b0\nfrom :7\nmerge :13\n--\n\nImporting that into git produces a trunk branch that only\ncontains the file README.txt. Something is evidently being lost in the\nmerge, but it's not clear how.\n\nDoes anyone have any idea what Fossil is doing wrong?\n\nM\n"},{"id":"274330","messageId":"1449968019-9570-1-git-send-email-szeder@ira.uka.de","threadId":"40979","inReplyTo":"20151212192540.4ba49fea@viper.int.arc7.info","subject":"Re: What's \"wrong\" with this fast-import?","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2015-12-13T00:53:39Z","receivedAt":"2015-12-13T00:53:39Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"> The symptom of the bug seems to be that if a branch B is created from\n> branch A, files committed to B, and then B merged with A, the committed\n> files are not present in the head of A.\n\nfast-import's 'merge' command doesn't actually perform a merge, it\nmerely records that the new commit has one more parent.  All changes\ncompared to the first parent (i.e. the addition of that new readme file\non the side branch) have to be listed explicitly.\n\n> As an example:\n> \n>   http://waste.io7m.com/2015/12/12/fossilexport/\n> \n> The given test.fossil repository was populated with the following steps:\n> \n>   1. Create fossil repository.\n>   2. Add README.txt and commit in trunk.\n>   3. Create branch 'b0' and switch to it.\n>   4. Add README-b0.txt and commit in b0.\n>   5. Switch to trunk.\n>   6. Merge and commit 'b0'.\n> \n> The HEAD of the fossil repository now contains README.txt and\n> README-b0.txt.\n> \n> Exporting the repository (see test.export) produces:\n> \n> --\n> blob\n> mark :4\n> data 7\n> Hello.\n> \n> blob\n> mark :10\n> data 10\n> Hello b0.\n> \n> commit refs/heads/trunk\n> mark :3\n> committer someone <someone> 1449930286 +0000\n> data 22\n> initial empty check-in\n> deleteall\n> \n> commit refs/heads/trunk\n> mark :7\n> committer someone <someone> 1449930317 +0000\n> data 7\n> Initial\n> from :3\n> M 100644 :4 README.txt\n> \n> commit refs/heads/b0\n> mark :9\n> committer someone <someone> 1449930338 +0000\n> data 28\n> Create new branch named \"b0\"\n> from :7\n> \n> commit refs/heads/b0\n> mark :13\n> committer someone <someone> 1449930374 +0000\n> data 13\n> Add README-b0\n> from :9\n> M 100644 :10 README-b0.txt\n> \n> commit refs/heads/trunk\n> mark :15\n> committer someone <someone> 1449930396 +0000\n> data 8\n> Merge b0\n> from :7\n> merge :13\n\nI.e. this commit should also contain the following filemodify command\nto add that new readme file:\n\n  M 100644 :10 README-b0.txt\n"},{"id":"274384","messageId":"20151214162038.23aaa1ab@viper.int.arc7.info","threadId":"40979","inReplyTo":"1449968019-9570-1-git-send-email-szeder@ira.uka.de","subject":"Re: What's \"wrong\" with this fast-import?","fromName":"","fromEmail":"com.git-scm@io7m.com","sentAt":"2015-12-14T16:20:38Z","receivedAt":"2015-12-14T16:20:38Z","isPatch":false,"sender":{"key":"com.git-scm@io7m.com","avatar":null},"body":"On 2015-12-13T01:53:39 +0100\nSZEDER Gábor <szeder@ira.uka.de> wrote:\n\n> All changes\n> compared to the first parent (i.e. the addition of that new readme file\n> on the side branch) have to be listed explicitly.\n> \n\nApologies for the delay: Thanks for this!\n\nIt seems that this issue was actually unintentionally fixed in newer\nversions of Fossil, but the schema of repositories created with older\nversions had to be updated in order to actually get the benefits of the\nfix.\n\nM\n"}]}