{"thread":{"id":"44274","subject":"Invisible file remove during merge","startedAt":"2016-10-11T01:14:51Z","lastAt":"2016-10-11T02:42:11Z","messageCount":2,"participants":["Octavio Alvarez","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"303850","messageId":"d7e42701-363b-70a4-8eb0-da4715cd9ba5@alvarezp.ods.org","threadId":"44274","inReplyTo":null,"subject":"Invisible file remove during merge","fromName":"Octavio Alvarez","fromEmail":"alvarezp@alvarezp.ods.org","sentAt":"2016-10-11T01:04:26Z","receivedAt":"2016-10-11T01:14:51Z","isPatch":false,"sender":{"key":"alvarezp@alvarezp.ods.org","avatar":null},"body":"Hi.\n\nIf I do a \"git rm file\" during conflict resolution, the removed file\n(mysterious-file.txt) does not show up on \"git log --stat\" nor \"git show\n--patch\" for the merge commit.\n\n\"git log --all --stat --follow -- mysterious-file.txt\" only shows the\ncommit where the file was added.\n\nI also tried --full-history\n\nI prepared a sample repository that exhibits a behavior I was not expecting:\n\nhttps://github.com/alvarezp/invisible-remove-git-demo\n\nAm I missing some option?\n\nThanks.\n\n"},{"id":"303851","messageId":"20161011024204.dg756vuej4rvg4tl@sigill.intra.peff.net","threadId":"44274","inReplyTo":"d7e42701-363b-70a4-8eb0-da4715cd9ba5@alvarezp.ods.org","subject":"Re: Invisible file remove during merge","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-10-11T02:42:04Z","receivedAt":"2016-10-11T02:42:11Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 10, 2016 at 06:04:26PM -0700, Octavio Alvarez wrote:\n\n> If I do a \"git rm file\" during conflict resolution, the removed file\n> (mysterious-file.txt) does not show up on \"git log --stat\" nor \"git show\n> --patch\" for the merge commit.\n\n\"git log\" does not do merge diffs by default; you need to pass one of\n\"--cc\", \"-c\", or \"-m\".\n\n\"git show\" will do \"--cc\" by default. Any file that is the same in the\nmerge result and _any_ of the branches is considered uninteresting here,\nand that is what happened in your example. One parent had the file, the\nother did not, and you deleted it to match the second parent.\n\nSee the \"Combined Diff\" section of \"git help log\" for more details.\n\nWhen debugging merge resolutions, I often find it useful to use \"-m\",\nwhich diffs separately against _each_ parent (though it is often tedious\nto pick through the uninteresting bits, which is why \"-c\" and \"--cc\"\nwere invented in the first place).\n\n> \"git log --all --stat --follow -- mysterious-file.txt\" only shows the\n> commit where the file was added.\n\nTry that with \"-m\", which will show the merge in question (and another,\nmore boring merge, which hopefully shows why \"-m\" is not the default).\n\n-Peff\n"}]}