{"thread":{"id":"31970","subject":"merge --squash strange error","startedAt":"2012-10-29T13:37:00Z","lastAt":"2012-10-29T13:37:00Z","messageCount":1,"participants":["Angelo Borsotti"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"202123","messageId":"CAB9Jk9DSrvsOp8++q87y6oMVrTSNcKyoM_vKJyWih96y4tG+fg@mail.gmail.com","threadId":"31970","inReplyTo":null,"subject":"merge --squash strange error","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-10-29T13:37:00Z","receivedAt":"2012-10-29T13:37:00Z","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\n"}]}