{"thread":{"id":"51557","subject":"Re: [BUG]: Destructive behaviour of git revert","startedAt":"2019-07-30T17:24:35Z","lastAt":"2019-07-30T18:36:23Z","messageCount":2,"participants":["Andreas Wiesinger","Phillip Wood"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"379585","messageId":"CAP82knOVE5RbcDbD-SqbkoZ_4qubi96n2p3M_vgc4xGFVwTpMw@mail.gmail.com","threadId":"51557","inReplyTo":"CAP82knNJ7YH30R-Z61ake58qERp--6hdvgGasKpHQ2TbMPraiA@mail.gmail.com","subject":"Re: [BUG]: Destructive behaviour of git revert","fromName":"Andreas Wiesinger","fromEmail":"awiesing90@gmail.com","sentAt":"2019-07-30T17:24:22Z","receivedAt":"2019-07-30T17:24:35Z","isPatch":false,"sender":{"key":"awiesing90@gmail.com","avatar":null},"body":"Hello,\n\ngit revert for merges will mark merged files as deleted and commit\nthem as if they would have been deleted, but that is for sure never\nwhat anybody would expect and has deleted many files unintentionally\nand unrecognized in our repo shortly.\n\nI have reproduced this issue in a very small example repo here:\nhttps://gitlab.com/electrocnic/git-revert-destructive-behaviour/tree/master\n\nExpected behaviour would be:\n\nA reverted merge should never mark any files or directories as\n\"deleted\", and merging the branch where the other merge has been\nreverted should not lead to the deletion of those files.\n\nI classify this behaviour as really really destructive and clearly a\nbug, even if this behaviour is by intention. It should not be by\nintention then..\n\nBest regards,\nAndreas\n"},{"id":"379593","messageId":"015916f3-9386-d541-0603-b361c44a7ae8@gmail.com","threadId":"51557","inReplyTo":"CAP82knOVE5RbcDbD-SqbkoZ_4qubi96n2p3M_vgc4xGFVwTpMw@mail.gmail.com","subject":"Re: [BUG]: Destructive behaviour of git revert","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2019-07-30T18:36:17Z","receivedAt":"2019-07-30T18:36:23Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Andreas\n\nOn 30/07/2019 18:24, Andreas Wiesinger wrote:\n> Hello,\n> \n> git revert for merges will mark merged files as deleted and commit\n> them as if they would have been deleted, but that is for sure never\n> what anybody would expect and has deleted many files unintentionally\n> and unrecognized in our repo shortly.\n> \n> I have reproduced this issue in a very small example repo here:\n> https://gitlab.com/electrocnic/git-revert-destructive-behaviour/tree/master\n> \n> Expected behaviour would be:\n> \n> A reverted merge should never mark any files or directories as\n> \"deleted\", and merging the branch where the other merge has been\n> reverted should not lead to the deletion of those files.\n\nThanks for creating an example. I've had a quick look at it and it \nappears that you have a merge that adds a new file from the branch being \nmerged, then when you revert the merge that file is deleted. Could you \nexplain what you want to happen when you revert that merge? The idea of \nrevert is to undo the changes introduced by the commit that is being \nreverted, I'm struggling to understand why you think revert should not \ndo this for files that are added.\n\nBest Wishes\n\nPhillip\n\n> I classify this behaviour as really really destructive and clearly a\n> bug, even if this behaviour is by intention. It should not be by\n> intention then..\n> \n> Best regards,\n> Andreas\n> \n"}]}