{"thread":{"id":"32109","subject":"merge --squash detects a nonexistent error","startedAt":"2012-11-14T07:26:36Z","lastAt":"2012-11-14T07:26:36Z","messageCount":1,"participants":["Angelo Borsotti"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203173","messageId":"CAB9Jk9ATdzQ5nSNDiKFMRMvyzKAOodC5n4Wan+AzSm_aDSLjRA@mail.gmail.com","threadId":"32109","inReplyTo":null,"subject":"merge --squash detects a nonexistent error","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-11-14T07:26:36Z","receivedAt":"2012-11-14T07:26:36Z","isPatch":false,"sender":{"key":"angelo.borsotti@gmail.com","avatar":null},"body":"Hello,\n\nI have got a case in which merge --squash issues an error that does\nnot exist. I hope I am wrong, though.\nConsider the following example:\n\nrm -rf public.git\nrm -rf private\ngit init --bare public.git\ngit clone public.git private\ncd private\ntouch f1; git add f1; git commit -m A\ngit checkout -b b1\ntouch f2; git add f2; git commit -m B\ngit checkout master\ngit checkout -b b2\ntouch f3; git add f3; git commit -m C\ngit checkout master\ngit checkout -b b3\ntouch f4; git add f4; git commit -m D\n\n--- at this point we have\n\n     A (f1)             master\n      |--B (f1,f2)     b1\n      |--C (f1,f3)     b2\n      `--D (f1,f4)     *b3\n\ngit merge --squash b1\ngit merge --squash b2\n\nThe first merge adds f2 to the workspace, which then contains f1, f2 and f4.\nThe second merge should add f3, and instead it complains:\n\nerror: Your local changes to the following files would be overwritten by merge:\n        f2\nPlease, commit your changes or stash them before you can merge.\nAborting\n\nWhy should it overwrite f2, and with what?\n\n-Angelo Borsotti\n"}]}