{"thread":{"id":"28481","subject":"[PATCH v0] fast-import: Add drop command","startedAt":"2011-09-24T15:27:44Z","lastAt":"2011-11-09T11:29:18Z","messageCount":15,"participants":["Vitor Antunes","Jonathan Nieder","Dmitry Ivankov","Sverre Rabbelier"],"isPatch":true,"patchVersion":0,"patchTotal":null},"messages":[{"id":"176127","messageId":"1316878065-11782-1-git-send-email-vitor.hda@gmail.com","threadId":"28481","inReplyTo":null,"subject":"[PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-09-24T15:27:44Z","receivedAt":"2011-09-24T15:27:44Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"First try in implementing the drop command that was discussed in the\npast. Please be gentle, as this is the first time I touch C in many\nyears. The git internals are also rather new to me.\n\nNo documentation and test cases were added at this point. It would be\ngreat if someone could implement the test case for me.\n\nVitor Antunes (1):\n  fast-import: Add drop command\n\n fast-import.c |   35 ++++++++++++++++++++++++++++++++++-\n 1 files changed, 34 insertions(+), 1 deletions(-)\n\n-- \n1.7.7.rc2.11.g4aecf.dirty\n"},{"id":"176128","messageId":"1316878065-11782-2-git-send-email-vitor.hda@gmail.com","threadId":"28481","inReplyTo":"1316878065-11782-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-09-24T15:27:45Z","receivedAt":"2011-09-24T15:27:45Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"The drop command deletes the given branch reference, allowing\nfast-import to actively ignore it in the final checks.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n fast-import.c |   35 ++++++++++++++++++++++++++++++++++-\n 1 files changed, 34 insertions(+), 1 deletions(-)\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 742e7da..906bbf4 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -743,6 +743,29 @@ static struct branch *new_branch(const char *name)\n \treturn b;\n }\n \n+static void release_tree_entry(struct tree_entry *e);\n+static void drop_branch(const char *name)\n+{\n+\tunsigned int hc = hc_str(name, strlen(name)) % branch_table_sz;\n+\tstruct branch *b_prev = NULL, *b = NULL;\n+\tstruct ref_lock *lock;\n+\tunsigned char old_sha1[20];\n+\n+\tfor (b = branch_table[hc]; b; b = b->table_next_branch) {\n+\t\tif (!strcmp(name, b->name)) {\n+\t\t\trelease_tree_entry(&b->branch_tree);\n+\t\t\tif (b_prev)\n+\t\t\t\tb_prev->table_next_branch = b->table_next_branch;\n+\t\t\tbranch_table[hc] = NULL;\n+\t\t\tbranch_count--;\n+\t\t}\n+\t\tb_prev = b;\n+\t}\n+\n+\tif (!read_ref(name, old_sha1))\n+\t\tdelete_ref(name, old_sha1, 0)\n+}\n+\n static unsigned int hc_entries(unsigned int cnt)\n {\n \tcnt = cnt & 7 ? (cnt / 8) + 1 : cnt / 8;\n@@ -776,7 +799,6 @@ static struct tree_content *new_tree_content(unsigned int cnt)\n \treturn t;\n }\n \n-static void release_tree_entry(struct tree_entry *e);\n static void release_tree_content(struct tree_content *t)\n {\n \tstruct avail_tree_content *f = (struct avail_tree_content*)t;\n@@ -2793,6 +2815,15 @@ static void parse_reset_branch(void)\n \t\tunread_command_buf = 1;\n }\n \n+static void parse_drop_branch(void)\n+{\n+\tchar *sp;\n+\n+\t/* Obtain the branch name from the rest of our command */\n+\tsp = strchr(command_buf.buf, ' ') + 1;\n+\tdrop_branch(sp);\n+}\n+\n static void cat_blob_write(const char *buf, unsigned long size)\n {\n \tif (write_in_full(cat_blob_fd, buf, size) != size)\n@@ -3332,6 +3363,8 @@ int main(int argc, const char **argv)\n \t\t\tparse_new_tag();\n \t\telse if (!prefixcmp(command_buf.buf, \"reset \"))\n \t\t\tparse_reset_branch();\n+\t\telse if (!prefixcmp(command_buf.buf, \"drop \"))\n+\t\t\tparse_drop_branch();\n \t\telse if (!strcmp(\"checkpoint\", command_buf.buf))\n \t\t\tparse_checkpoint();\n \t\telse if (!strcmp(\"done\", command_buf.buf))\n-- \n1.7.7.rc2.11.g4aecf.dirty\n"},{"id":"176135","messageId":"20110924193733.GB10955@elie","threadId":"28481","inReplyTo":"1316878065-11782-2-git-send-email-vitor.hda@gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-24T19:37:33Z","receivedAt":"2011-09-24T19:37:33Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Vitor Antunes wrote:\n\n> The drop command deletes the given branch reference, allowing\n> fast-import to actively ignore it in the final checks.\n\nThanks.  I must have missed the earlier discussion.  What are the\nsemantics of this command and its intended purpose?  For example, what\nhappens if the branch already existed or if there is a checkpoint\n(perhaps triggered by the impatient user sending SIGUSR1 to\nfast-import) before the \"drop\" command is processed?\n\nJonathan\n"},{"id":"176141","messageId":"CA+gfSn8Z7Xn1hdpqNHiP3bd2KGRqcAc6O683Z4O+G=jNNYJtBA@mail.gmail.com","threadId":"28481","inReplyTo":"20110924193733.GB10955@elie","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Dmitry Ivankov","fromEmail":"divanorama@gmail.com","sentAt":"2011-09-24T21:19:57Z","receivedAt":"2011-09-24T21:19:57Z","isPatch":true,"sender":{"key":"divanorama@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158999?v=4"},"body":"On Sun, Sep 25, 2011 at 1:37 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Vitor Antunes wrote:\n>\n>> The drop command deletes the given branch reference, allowing\n>> fast-import to actively ignore it in the final checks.\n>\n> Thanks.  I must have missed the earlier discussion.  What are the\n> semantics of this command and its intended purpose?\nMy guess is that if fast-import is used to manage a set of \"remote\"\nbranches, it should be able to delete branches. Then, it should\nbe allowed to do non-fastforward updates too (--force). Why can't\nit just ignore branches deletion (considering --force)?\n\nRandom thoughts:\n1. once 'drop' is executed, fast-import can't tell if the branch was\nactually deleted. And moreover any attempt to read this branch\nhead becomes illegal (either it's missing in .git or fast-import is\ninstructed to use a dropped branch).\n2. 'reset' command is a bit like proposed 'drop' but it never deletes\na branch ref. Consider following imports:\n1) import branch topic\n2) reset topic\n3) import branch topic2 starting at topic (incorrect import)\nIf 1-3) is done in one fast-import process, the error is reported.\nIf 3) is done separately, it succeeds but the result is strange:\ntopic2 isn't started from scratch but from old \"erased\" topic.\nSo, maybe, reset should be fixed to erase branches on --force.\n\nOne more scenario is:\n1) import topic\n2) reset topic\n3) import topic\nIf 1-3) go together - no error\nIf 3) goes separate - no error, but non-fastforward update.\nMuch more harmless, but still may look strange.\n\n> For example, what\n> happens if the branch already existed or if there is a checkpoint\n> (perhaps triggered by the impatient user sending SIGUSR1 to\n> fast-import) before the \"drop\" command is processed?\nI think that actual ref deletion should take place in update_branch().\nSo all the cases would be handled as usual.\n\n> Jonathan\n>\n"},{"id":"176142","messageId":"20110924223526.02ca9edf@fenix.utopia.dhis.org","threadId":"28481","inReplyTo":"20110924193733.GB10955@elie","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-09-24T21:35:26Z","receivedAt":"2011-09-24T21:35:26Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Sep 24, 2011 8:37 PM, \"Jonathan Nieder\" <jrnieder@gmail.com> wrote:\n> Thanks.  I must have missed the earlier discussion.  What are the\n> semantics of this command and its intended purpose?  For example, what\n> happens if the branch already existed or if there is a checkpoint\n> (perhaps triggered by the impatient user sending SIGUSR1 to\n> fast-import) before the \"drop\" command is processed?\n\nIn the tests I made there are checkpoints triggered before using the\ncommand. I tried to remove the branch within fast-import variables as well\nas the already processed objects in git.\n\nThis command is required because I need to reset a given branch multiple\ntimes in order to be able to \"guess\" its origin commit in the parent branch.\nTo make this analysis I also need to use \"checkpoint\" at each try.\n\n(Resending... apparently gmail Android app sends a HTML attachment)\n"},{"id":"176317","messageId":"CAOpHH-WSyD23GKtZ2nLiSsJfLU-+7ibyGhGccyvtAhKQ-jffBw@mail.gmail.com","threadId":"28481","inReplyTo":"CA+gfSn8Z7Xn1hdpqNHiP3bd2KGRqcAc6O683Z4O+G=jNNYJtBA@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-09-27T08:57:02Z","receivedAt":"2011-09-27T08:57:02Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Sat, Sep 24, 2011 at 10:19 PM, Dmitry Ivankov <divanorama@gmail.com> wrote:\n> On Sun, Sep 25, 2011 at 1:37 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Thanks.  I must have missed the earlier discussion.  What are the\n>> semantics of this command and its intended purpose?\n> My guess is that if fast-import is used to manage a set of \"remote\"\n> branches, it should be able to delete branches. Then, it should\n> be allowed to do non-fastforward updates too (--force). Why can't\n> it just ignore branches deletion (considering --force)?\n\nI started by using --force, but I did not want to completely disable\nthese checks. The idea of the drop command is to add support to the\nexceptions that require non-fastforward updates.\n\n> Random thoughts:\n> 1. once 'drop' is executed, fast-import can't tell if the branch was\n> actually deleted. And moreover any attempt to read this branch\n> head becomes illegal (either it's missing in .git or fast-import is\n> instructed to use a dropped branch).\n> 2. 'reset' command is a bit like proposed 'drop' but it never deletes\n> a branch ref. Consider following imports:\n> 1) import branch topic\n> 2) reset topic\n> 3) import branch topic2 starting at topic (incorrect import)\n> If 1-3) is done in one fast-import process, the error is reported.\n> If 3) is done separately, it succeeds but the result is strange:\n> topic2 isn't started from scratch but from old \"erased\" topic.\n> So, maybe, reset should be fixed to erase branches on --force.\n\nI think you are not considering the possibility that checkpoints could\nhave been done along the way. I use them frequently to be able to\nanalyse branches with diff-tree. As soon as a checkpoint is done,\nupdate-branches will issue an error (commit A is not part of branch A').\n\n> One more scenario is:\n> 1) import topic\n> 2) reset topic\n> 3) import topic\n> If 1-3) go together - no error\n> If 3) goes separate - no error, but non-fastforward update.\n> Much more harmless, but still may look strange.\n\nNot exactly true if there is a checkpoint done after step 1.\n\nMy scenario is:\n\n1) import topic\n2) checkpoint\n3) diff-tree and processing\n4) exit if processing returns ok\n5) reset topic to another HEAD\n6) goto 1)\n\n-- \nVitor Antunes\n"},{"id":"178242","messageId":"CAOpHH-WxhvEP58KkGhnJbATbzU6PDBeQB1_fhbQ+0fzDXznaYw@mail.gmail.com","threadId":"28481","inReplyTo":"CAOpHH-WSyD23GKtZ2nLiSsJfLU-+7ibyGhGccyvtAhKQ-jffBw@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-10-24T16:37:20Z","receivedAt":"2011-10-24T16:37:20Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi,\n\nThis thread did not receive any updates for a long time.\nCould someone provide some feedback?\n\nIs this feasible? Does it make sense to add this command? If not, why?\n\nThanks,\nVitor\n\nOn Tue, Sep 27, 2011 at 9:57 AM, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> On Sat, Sep 24, 2011 at 10:19 PM, Dmitry Ivankov <divanorama@gmail.com> wrote:\n>> On Sun, Sep 25, 2011 at 1:37 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> Thanks.  I must have missed the earlier discussion.  What are the\n>>> semantics of this command and its intended purpose?\n>> My guess is that if fast-import is used to manage a set of \"remote\"\n>> branches, it should be able to delete branches. Then, it should\n>> be allowed to do non-fastforward updates too (--force). Why can't\n>> it just ignore branches deletion (considering --force)?\n>\n> I started by using --force, but I did not want to completely disable\n> these checks. The idea of the drop command is to add support to the\n> exceptions that require non-fastforward updates.\n>\n>> Random thoughts:\n>> 1. once 'drop' is executed, fast-import can't tell if the branch was\n>> actually deleted. And moreover any attempt to read this branch\n>> head becomes illegal (either it's missing in .git or fast-import is\n>> instructed to use a dropped branch).\n>> 2. 'reset' command is a bit like proposed 'drop' but it never deletes\n>> a branch ref. Consider following imports:\n>> 1) import branch topic\n>> 2) reset topic\n>> 3) import branch topic2 starting at topic (incorrect import)\n>> If 1-3) is done in one fast-import process, the error is reported.\n>> If 3) is done separately, it succeeds but the result is strange:\n>> topic2 isn't started from scratch but from old \"erased\" topic.\n>> So, maybe, reset should be fixed to erase branches on --force.\n>\n> I think you are not considering the possibility that checkpoints could\n> have been done along the way. I use them frequently to be able to\n> analyse branches with diff-tree. As soon as a checkpoint is done,\n> update-branches will issue an error (commit A is not part of branch A').\n>\n>> One more scenario is:\n>> 1) import topic\n>> 2) reset topic\n>> 3) import topic\n>> If 1-3) go together - no error\n>> If 3) goes separate - no error, but non-fastforward update.\n>> Much more harmless, but still may look strange.\n>\n> Not exactly true if there is a checkpoint done after step 1.\n>\n> My scenario is:\n>\n> 1) import topic\n> 2) checkpoint\n> 3) diff-tree and processing\n> 4) exit if processing returns ok\n> 5) reset topic to another HEAD\n> 6) goto 1)\n"},{"id":"178244","messageId":"CAGdFq_heamPfKpK2sQ1RUvceaeGRVAwkv=KAn-ByPyPkNtoZBA@mail.gmail.com","threadId":"28481","inReplyTo":"CAOpHH-WxhvEP58KkGhnJbATbzU6PDBeQB1_fhbQ+0fzDXznaYw@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-10-24T18:01:56Z","receivedAt":"2011-10-24T18:01:56Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, Oct 24, 2011 at 18:37, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> This thread did not receive any updates for a long time.\n> Could someone provide some feedback?\n>\n> Is this feasible? Does it make sense to add this command? If not, why?\n\nI for one welcome our new branch deleting overlords :).\n\nYou mention that checkpointing solves some of the concerns raised by\nothers in this thread, would automatic checkpointing be way to make\nsure everything is as it should be?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"178259","messageId":"CAOpHH-VEhtOg6ai5p9VxWBKA3AFpG3meiJVGrWR4j68ffyQ6Bg@mail.gmail.com","threadId":"28481","inReplyTo":"CAGdFq_heamPfKpK2sQ1RUvceaeGRVAwkv=KAn-ByPyPkNtoZBA@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-10-25T09:56:15Z","receivedAt":"2011-10-25T09:56:15Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Mon, Oct 24, 2011 at 7:01 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> I for one welcome our new branch deleting overlords :).\n>\n> You mention that checkpointing solves some of the concerns raised by\n> others in this thread, would automatic checkpointing be way to make\n> sure everything is as it should be?\n\nApparently I did not explain myself correctly. Let me try again :)\n\nThis is what I am doing:\n\n1) import topic\n2) checkpoint\n3) diff-tree and processing\n4) exit if processing returns ok\n5) reset topic to another HEAD\n6) goto 1)\n\nIn this scenario it is the checkpoint that \"breaks\" everything because\nit will write the original tree to disk. When fast-import exits it will\nfind the old tree on disk but not within \"topic\" tree.\n\nSo, no, I don't think that automatic checkpointing would make anything\neasier. Quite the opposite!\n\n-- \nVitor Antunes\n"},{"id":"178351","messageId":"CAGdFq_iY92Gc=WLFVVMpi8w5JNZMo5bSk5=wjHyCmjXmP4RXrQ@mail.gmail.com","threadId":"28481","inReplyTo":"CAOpHH-VEhtOg6ai5p9VxWBKA3AFpG3meiJVGrWR4j68ffyQ6Bg@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-10-27T11:06:19Z","receivedAt":"2011-10-27T11:06:19Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Tue, Oct 25, 2011 at 11:56, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> On Mon, Oct 24, 2011 at 7:01 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>> I for one welcome our new branch deleting overlords :).\n>>\n>> You mention that checkpointing solves some of the concerns raised by\n>> others in this thread, would automatic checkpointing be way to make\n>> sure everything is as it should be?\n>\n> Apparently I did not explain myself correctly. Let me try again :)\n>\n> This is what I am doing:\n>\n> 1) import topic\n> 2) checkpoint\n> 3) diff-tree and processing\n> 4) exit if processing returns ok\n> 5) reset topic to another HEAD\n> 6) goto 1)\n>\n> In this scenario it is the checkpoint that \"breaks\" everything because\n> it will write the original tree to disk. When fast-import exits it will\n> find the old tree on disk but not within \"topic\" tree.\n\nI'm afraid I don't understand why it's a bad thing that fast-import\nwill find the old tree on disk, won't it just be gc-ed if it is no\nlonger used?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"178352","messageId":"CAOpHH-W30umoP6CuvrXgiSPBC2NjLvNWUX0uxhU4SU3kBB4H-A@mail.gmail.com","threadId":"28481","inReplyTo":"CAGdFq_iY92Gc=WLFVVMpi8w5JNZMo5bSk5=wjHyCmjXmP4RXrQ@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-10-27T11:22:08Z","receivedAt":"2011-10-27T11:22:08Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Thu, Oct 27, 2011 at 12:06 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> I'm afraid I don't understand why it's a bad thing that fast-import\n> will find the old tree on disk, won't it just be gc-ed if it is no\n> longer used?\n\nNo, because fast-import actively checks this to make sure the frontend\nscript did not do anything wrong during the import. I think the check\nmakes sense and may help debugging a corner case the frontend script\ndoes not support. So, using \"--force\" is also not a solution because it\nignores everything and not only the specific commits I want to leave\nbehind.\n\nVitor\n"},{"id":"178353","messageId":"CAGdFq_hSnywznK=3JgWBVigGZmS0ry_WHuuDww5tvPrcsPd7cQ@mail.gmail.com","threadId":"28481","inReplyTo":"CAOpHH-W30umoP6CuvrXgiSPBC2NjLvNWUX0uxhU4SU3kBB4H-A@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-10-27T14:36:58Z","receivedAt":"2011-10-27T14:36:58Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Oct 27, 2011 at 13:22, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> On Thu, Oct 27, 2011 at 12:06 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>> I'm afraid I don't understand why it's a bad thing that fast-import\n>> will find the old tree on disk, won't it just be gc-ed if it is no\n>> longer used?\n>\n> No, because fast-import actively checks this to make sure the frontend\n> script did not do anything wrong during the import. I think the check\n> makes sense and may help debugging a corner case the frontend script\n> does not support. So, using \"--force\" is also not a solution because it\n> ignores everything and not only the specific commits I want to leave\n> behind.\n\nOk, so the problem is that fast-import notices that a tree that was\nwritten out as part of a checkpoint is later removed and doesn't like\nthat? Shouldn't we just teach the check about trees deleted by the\ndrop command?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"179171","messageId":"CAOpHH-X3bgJpRpiJMy-iDDpaFbUy8yZK+GFEwVB2vGHd-GpUiw@mail.gmail.com","threadId":"28481","inReplyTo":"CAGdFq_hSnywznK=3JgWBVigGZmS0ry_WHuuDww5tvPrcsPd7cQ@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-11-09T00:24:38Z","receivedAt":"2011-11-09T00:24:38Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Sverre,\n\nSorry for the late reply.\n\nOn Thu, Oct 27, 2011 at 3:36 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> Ok, so the problem is that fast-import notices that a tree that was\n> written out as part of a checkpoint is later removed and doesn't like\n> that? Shouldn't we just teach the check about trees deleted by the\n> drop command?\n\nThat was exactly my intention when I used release_tree_entry(). But I\nguess I'm doing it wrong, because without the delete_ref() part this\ndoes not work (just noticed there's a missing semicolon there...\nsorry). Any advices/guidance, please? :)\n\n-- \nVitor Antunes\n"},{"id":"179172","messageId":"CAGdFq_jPfSFidb59m-5Tsyusw3yQFRnxU9nqBVosVPuzbt86GA@mail.gmail.com","threadId":"28481","inReplyTo":"CAOpHH-X3bgJpRpiJMy-iDDpaFbUy8yZK+GFEwVB2vGHd-GpUiw@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-11-09T00:27:03Z","receivedAt":"2011-11-09T00:27:03Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Nov 9, 2011 at 01:24, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> On Thu, Oct 27, 2011 at 3:36 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>> Ok, so the problem is that fast-import notices that a tree that was\n>> written out as part of a checkpoint is later removed and doesn't like\n>> that? Shouldn't we just teach the check about trees deleted by the\n>> drop command?\n>\n> That was exactly my intention when I used release_tree_entry(). But I\n> guess I'm doing it wrong, because without the delete_ref() part this\n> does not work (just noticed there's a missing semicolon there...\n> sorry). Any advices/guidance, please? :)\n\nENODATA. What do you mean with \"does not work\"? Can you run it through\ngdb and see what's going on?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"179202","messageId":"CAOpHH-W8x2hAmH5hiRovQG+aV6NuX4MopGc2n3Lhqtv=7crW6A@mail.gmail.com","threadId":"28481","inReplyTo":"CAGdFq_jPfSFidb59m-5Tsyusw3yQFRnxU9nqBVosVPuzbt86GA@mail.gmail.com","subject":"Re: [PATCH v0] fast-import: Add drop command","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-11-09T11:29:18Z","receivedAt":"2011-11-09T11:29:18Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"On Wed, Nov 9, 2011 at 12:27 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> Heya,\n>\n> On Wed, Nov 9, 2011 at 01:24, Vitor Antunes <vitor.hda@gmail.com> wrote:\n>>\n>> That was exactly my intention when I used release_tree_entry(). But I\n>> guess I'm doing it wrong, because without the delete_ref() part this\n>> does not work (just noticed there's a missing semicolon there...\n>> sorry). Any advices/guidance, please? :)\n>\n> ENODATA. What do you mean with \"does not work\"? Can you run it through\n> gdb and see what's going on?\n\nCalm down! It's not that bad to require gdb :)\n\nIt just means that even using the drop() command from the patch I\nposted before, I still get the \"new tip ... does not contain\n...\" error from fast-import.\n\n-- \nVitor Antunes\n"}]}