{"thread":{"id":"36985","subject":"files deleted with no record?","startedAt":"2014-06-24T01:15:09Z","lastAt":"2014-06-26T21:00:57Z","messageCount":5,"participants":["Jeremy Scott","Phil Hord","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"244906","messageId":"CAFDwLfyXrUZUUuaciAjamn-cXJ6mAv_D41zLwT4AZE=cmAX7rg@mail.gmail.com","threadId":"36985","inReplyTo":null,"subject":"files deleted with no record?","fromName":"Jeremy Scott","fromEmail":"jeremy@great-scotts.org","sentAt":"2014-06-24T01:15:09Z","receivedAt":"2014-06-24T01:15:09Z","isPatch":false,"sender":{"key":"jeremy@great-scotts.org","avatar":null},"body":"I just encountered a situation where a merge was made, with no\napparent changes in files (ie no log), but the result was that some\nfiles were deleted.\n\n\n\nperson A adds some files\nperson B adds some files from the same point\nperson B commits and pushes.\nperson A commits -- now merge is required\na few more commits on top of person B's commit\nperson A merges - this removes the files that B added. There is no log\nof the files being deleted\n\nClearly this is possible - was this a user error?\n\n\n\nThanks\n"},{"id":"245026","messageId":"CABURp0p6amKmhMhOUzdKy0a8TY7bmPoSLM0sUnZfGErhyfLsEQ@mail.gmail.com","threadId":"36985","inReplyTo":"CAFDwLfyXrUZUUuaciAjamn-cXJ6mAv_D41zLwT4AZE=cmAX7rg@mail.gmail.com","subject":"Re: files deleted with no record?","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2014-06-26T16:47:43Z","receivedAt":"2014-06-26T16:47:43Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"On Mon, Jun 23, 2014 at 9:15 PM, Jeremy Scott <jeremy@great-scotts.org> wrote:\n> I just encountered a situation where a merge was made, with no\n> apparent changes in files (ie no log), but the result was that some\n> files were deleted.\n>\n> person A adds some files\n> person B adds some files from the same point\n\nYou mean from the same point in history, right?  Not files with the\nsame filename or path?\n\n> person B commits and pushes.\n> person A commits -- now merge is required\n> a few more commits on top of person B's commit\n\nI don't understand this step.  Who adds a few more commits on top of B and why?\n\n> person A merges - this removes the files that B added. There is no log\n> of the files being deleted\n\nThis sounds like an \"evil merge\" (see man gitglossary, and google),\nbut it's not clear to me how you arrived here.\n\nWhen I tried to reproduce your issue with this script, it did not\nremove any files unexpectedly:\n------------------->8-----------------------\n#!/bin/sh\n\nset -e\nmkdir foo && cd foo && git init\necho foo > foo && git add foo && git commit -mfoo\n\ngit checkout -b PersonA master\necho bar > bar && git add bar\ngit commit -m\"PersonA: bar\"\n\ngit checkout -b PersonB master\necho baz > baz && git add baz\ngit commit -m\"PersonB: baz\"\n\necho foo-conflict >> foo && git add foo\ngit commit -m\"PersonB: foo\"\n\ngit checkout PersonA\necho foo-different >> foo && git add foo\ngit commit -m\"PersonA: foo (conflicts with PersonB)\"\n\ngit log --oneline --all --stat\n\nif ! git merge PersonB ; then\n  git checkout PersonA foo\n  git commit --no-edit\nfi\ngit log --oneline --graph --stat\n------------------->8-----------------------\n\nA sneaky issue with merges is that they do not have a clear way to\nshow patch information -- the diff between the commit and its ancestor\n-- because they have multiple ancestors.  You can show diffs for a\nmerge relative to each of its parents, but it is not usually done for\nyou automatically.  This is why making changes in a merge which are\nnot actually required for the merge is bad (\"evil\").\n\n> Clearly this is possible - was this a user error?\n\nProbably, but we'd need to see how the user got there.\n"},{"id":"245040","messageId":"7298A047128B405F94F5E73903089107@PhilipOakley","threadId":"36985","inReplyTo":"CABURp0p6amKmhMhOUzdKy0a8TY7bmPoSLM0sUnZfGErhyfLsEQ@mail.gmail.com","subject":"Re: files deleted with no record?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-06-26T19:53:36Z","receivedAt":"2014-06-26T19:53:36Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Phil Hord\" <phil.hord@gmail.com>\n> On Mon, Jun 23, 2014 at 9:15 PM, Jeremy Scott \n> <jeremy@great-scotts.org> wrote:\n>> I just encountered a situation where a merge was made, with no\n>> apparent changes in files (ie no log), but the result was that some\n>> files were deleted.\n>>\n>> person A adds some files\n>> person B adds some files from the same point\n>\n> You mean from the same point in history, right?  Not files with the\n> same filename or path?\n>\n>> person B commits and pushes.\n>> person A commits -- now merge is required\n>> a few more commits on top of person B's commit\n>\n> I don't understand this step.  Who adds a few more commits on top of B \n> and why?\n>\n>> person A merges - this removes the files that B added. There is no \n>> log\n>> of the files being deleted\n\nA similar issue, by reference, just came up on the [git-users] list. The \nreference was:\n1. http://randyfay.com/content/avoiding-git-disasters-gory-story\n\nIn that case the problem was a mixture of tools and  misunderstandings.\n\nIt may not be the same as your case, but could give insights into what's \nhappening between different developers.\n\nWhich Tools are You, person A and Person B using, with --version?\n\n>\n> This sounds like an \"evil merge\" (see man gitglossary, and google),\n> but it's not clear to me how you arrived here.\n>\n> When I tried to reproduce your issue with this script, it did not\n> remove any files unexpectedly:\n> ------------------->8-----------------------\n> #!/bin/sh\n>\n> set -e\n> mkdir foo && cd foo && git init\n> echo foo > foo && git add foo && git commit -mfoo\n>\n> git checkout -b PersonA master\n> echo bar > bar && git add bar\n> git commit -m\"PersonA: bar\"\n>\n> git checkout -b PersonB master\n> echo baz > baz && git add baz\n> git commit -m\"PersonB: baz\"\n>\n> echo foo-conflict >> foo && git add foo\n> git commit -m\"PersonB: foo\"\n>\n> git checkout PersonA\n> echo foo-different >> foo && git add foo\n> git commit -m\"PersonA: foo (conflicts with PersonB)\"\n>\n> git log --oneline --all --stat\n>\n> if ! git merge PersonB ; then\n>  git checkout PersonA foo\n>  git commit --no-edit\n> fi\n> git log --oneline --graph --stat\n> ------------------->8-----------------------\n>\n> A sneaky issue with merges is that they do not have a clear way to\n> show patch information -- the diff between the commit and its ancestor\n> -- because they have multiple ancestors.  You can show diffs for a\n> merge relative to each of its parents, but it is not usually done for\n> you automatically.  This is why making changes in a merge which are\n> not actually required for the merge is bad (\"evil\").\n>\n>> Clearly this is possible - was this a user error?\n>\n> Probably, but we'd need to see how the user got there.\n> --\nPhilip \n"},{"id":"245043","messageId":"CAFDwLfwdcka25o0S_-ekb+AAFRVDADeiZD1f5kXJczqei=e3eg@mail.gmail.com","threadId":"36985","inReplyTo":"7298A047128B405F94F5E73903089107@PhilipOakley","subject":"Re: files deleted with no record?","fromName":"Jeremy Scott","fromEmail":"jeremy@great-scotts.org","sentAt":"2014-06-26T20:57:48Z","receivedAt":"2014-06-26T20:57:48Z","isPatch":false,"sender":{"key":"jeremy@great-scotts.org","avatar":null},"body":"Hi. Thanks for getting back to me.\n\nhere is a screenshot from source tree to visualise the scenario:\n\nhttps://drive.google.com/file/d/0B-Wn7DfHsuhyTEVkRHAzeGVZelpMWjFxZW1kbVBKVlNab3pR/edit?usp=sharing\n\nI will attempt a script to reproduce this later today.\n\nThanks\n\nOn Fri, Jun 27, 2014 at 5:53 AM, Philip Oakley <philipoakley@iee.org> wrote:\n> From: \"Phil Hord\" <phil.hord@gmail.com>\n>\n>> On Mon, Jun 23, 2014 at 9:15 PM, Jeremy Scott <jeremy@great-scotts.org>\n>> wrote:\n>>>\n>>> I just encountered a situation where a merge was made, with no\n>>> apparent changes in files (ie no log), but the result was that some\n>>> files were deleted.\n>>>\n>>> person A adds some files\n>>> person B adds some files from the same point\n>>\n>>\n>> You mean from the same point in history, right?  Not files with the\n>> same filename or path?\n>>\n>>> person B commits and pushes.\n>>> person A commits -- now merge is required\n>>> a few more commits on top of person B's commit\n>>\n>>\n>> I don't understand this step.  Who adds a few more commits on top of B and\n>> why?\n>>\n>>> person A merges - this removes the files that B added. There is no log\n>>> of the files being deleted\n>\n>\n> A similar issue, by reference, just came up on the [git-users] list. The\n> reference was:\n> 1. http://randyfay.com/content/avoiding-git-disasters-gory-story\n>\n> In that case the problem was a mixture of tools and  misunderstandings.\n>\n> It may not be the same as your case, but could give insights into what's\n> happening between different developers.\n>\n> Which Tools are You, person A and Person B using, with --version?\n>\n>>\n>> This sounds like an \"evil merge\" (see man gitglossary, and google),\n>> but it's not clear to me how you arrived here.\n>>\n>> When I tried to reproduce your issue with this script, it did not\n>> remove any files unexpectedly:\n>> ------------------->8-----------------------\n>> #!/bin/sh\n>>\n>> set -e\n>> mkdir foo && cd foo && git init\n>> echo foo > foo && git add foo && git commit -mfoo\n>>\n>> git checkout -b PersonA master\n>> echo bar > bar && git add bar\n>> git commit -m\"PersonA: bar\"\n>>\n>> git checkout -b PersonB master\n>> echo baz > baz && git add baz\n>> git commit -m\"PersonB: baz\"\n>>\n>> echo foo-conflict >> foo && git add foo\n>> git commit -m\"PersonB: foo\"\n>>\n>> git checkout PersonA\n>> echo foo-different >> foo && git add foo\n>> git commit -m\"PersonA: foo (conflicts with PersonB)\"\n>>\n>> git log --oneline --all --stat\n>>\n>> if ! git merge PersonB ; then\n>>  git checkout PersonA foo\n>>  git commit --no-edit\n>> fi\n>> git log --oneline --graph --stat\n>> ------------------->8-----------------------\n>>\n>> A sneaky issue with merges is that they do not have a clear way to\n>> show patch information -- the diff between the commit and its ancestor\n>> -- because they have multiple ancestors.  You can show diffs for a\n>> merge relative to each of its parents, but it is not usually done for\n>> you automatically.  This is why making changes in a merge which are\n>> not actually required for the merge is bad (\"evil\").\n>>\n>>> Clearly this is possible - was this a user error?\n>>\n>>\n>> Probably, but we'd need to see how the user got there.\n>> --\n>\n> Philip\n"},{"id":"245044","messageId":"CAFDwLfzVX_A-6dEVpJccjfrQD7266dzgG9t-KeC4p15dvN1gyQ@mail.gmail.com","threadId":"36985","inReplyTo":"CAFDwLfyB+TAFQbU==YVX3W1wbpuBdigyFo5AZsk7CGAqtH4LpA@mail.gmail.com","subject":"Re: files deleted with no record?","fromName":"Jeremy Scott","fromEmail":"jeremy@great-scotts.org","sentAt":"2014-06-26T21:00:57Z","receivedAt":"2014-06-26T21:00:57Z","isPatch":false,"sender":{"key":"jeremy@great-scotts.org","avatar":null},"body":"we're all using source tree. I'm really interested to try and\nreproduce this so I'll find some time today to do it.\n\nThanks again\n\nOn Fri, Jun 27, 2014 at 6:56 AM, Jeremy Scott <jeremy@great-scotts.org> wrote:\n> Hi. Thanks for getting back to me.\n>\n> here is a screenshot from source tree to visualise the scenario:\n>\n> https://drive.google.com/file/d/0B-Wn7DfHsuhyTEVkRHAzeGVZelpMWjFxZW1kbVBKVlNab3pR/edit?usp=sharing\n>\n> I will attempt a script to reproduce this later today.\n>\n> Thanks\n>\n>\n>\n>\n>\n>\n>\n>\n>\n> On Fri, Jun 27, 2014 at 5:53 AM, Philip Oakley <philipoakley@iee.org> wrote:\n>>\n>> From: \"Phil Hord\" <phil.hord@gmail.com>\n>>\n>>> On Mon, Jun 23, 2014 at 9:15 PM, Jeremy Scott <jeremy@great-scotts.org>\n>>> wrote:\n>>>>\n>>>> I just encountered a situation where a merge was made, with no\n>>>> apparent changes in files (ie no log), but the result was that some\n>>>> files were deleted.\n>>>>\n>>>> person A adds some files\n>>>> person B adds some files from the same point\n>>>\n>>>\n>>> You mean from the same point in history, right?  Not files with the\n>>> same filename or path?\n>>>\n>>>> person B commits and pushes.\n>>>> person A commits -- now merge is required\n>>>> a few more commits on top of person B's commit\n>>>\n>>>\n>>> I don't understand this step.  Who adds a few more commits on top of B\n>>> and why?\n>>>\n>>>> person A merges - this removes the files that B added. There is no log\n>>>> of the files being deleted\n>>\n>>\n>> A similar issue, by reference, just came up on the [git-users] list. The\n>> reference was:\n>> 1. http://randyfay.com/content/avoiding-git-disasters-gory-story\n>>\n>> In that case the problem was a mixture of tools and  misunderstandings.\n>>\n>> It may not be the same as your case, but could give insights into what's\n>> happening between different developers.\n>>\n>> Which Tools are You, person A and Person B using, with --version?\n>>\n>>>\n>>> This sounds like an \"evil merge\" (see man gitglossary, and google),\n>>> but it's not clear to me how you arrived here.\n>>>\n>>> When I tried to reproduce your issue with this script, it did not\n>>> remove any files unexpectedly:\n>>> ------------------->8-----------------------\n>>> #!/bin/sh\n>>>\n>>> set -e\n>>> mkdir foo && cd foo && git init\n>>> echo foo > foo && git add foo && git commit -mfoo\n>>>\n>>> git checkout -b PersonA master\n>>> echo bar > bar && git add bar\n>>> git commit -m\"PersonA: bar\"\n>>>\n>>> git checkout -b PersonB master\n>>> echo baz > baz && git add baz\n>>> git commit -m\"PersonB: baz\"\n>>>\n>>> echo foo-conflict >> foo && git add foo\n>>> git commit -m\"PersonB: foo\"\n>>>\n>>> git checkout PersonA\n>>> echo foo-different >> foo && git add foo\n>>> git commit -m\"PersonA: foo (conflicts with PersonB)\"\n>>>\n>>> git log --oneline --all --stat\n>>>\n>>> if ! git merge PersonB ; then\n>>>  git checkout PersonA foo\n>>>  git commit --no-edit\n>>> fi\n>>> git log --oneline --graph --stat\n>>> ------------------->8-----------------------\n>>>\n>>> A sneaky issue with merges is that they do not have a clear way to\n>>> show patch information -- the diff between the commit and its ancestor\n>>> -- because they have multiple ancestors.  You can show diffs for a\n>>> merge relative to each of its parents, but it is not usually done for\n>>> you automatically.  This is why making changes in a merge which are\n>>> not actually required for the merge is bad (\"evil\").\n>>>\n>>>> Clearly this is possible - was this a user error?\n>>>\n>>>\n>>> Probably, but we'd need to see how the user got there.\n>>> --\n>>\n>> Philip\n>\n>\n"}]}