{"thread":{"id":"57432","subject":"When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes","startedAt":"2022-02-17T21:00:16Z","lastAt":"2022-02-23T21:23:35Z","messageCount":3,"participants":["Yuri","Phillip Wood","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"448733","messageId":"efdd752b-5cff-c483-80eb-654b53fdde7c@tsoft.com","threadId":"57432","inReplyTo":null,"subject":"When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes","fromName":"Yuri","fromEmail":"yuri@tsoft.com","sentAt":"2022-02-17T20:50:53Z","receivedAt":"2022-02-17T21:00:16Z","isPatch":false,"sender":{"key":"yuri@tsoft.com","avatar":null},"body":"I have a file \"x\" that has one local change and some incoming pulled \nchanges.\n\nPulled changes are contextually very far away, so it should be possible \nto merge them without user interaction.\n\nBut git still complains:\n\n$ git pull\nUpdating 91bfe02..522ccf2\nerror: Your local changes to the following files would be overwritten by \nmerge:\n     x\n\n\nYuri\n\n\n"},{"id":"449167","messageId":"3101d7c2-c78c-1f96-a7c6-08979d8f246b@gmail.com","threadId":"57432","inReplyTo":"efdd752b-5cff-c483-80eb-654b53fdde7c@tsoft.com","subject":"Re: When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2022-02-22T16:37:44Z","receivedAt":"2022-02-22T16:37:58Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Yuri\n\nOn 17/02/2022 20:50, Yuri wrote:\n> I have a file \"x\" that has one local change and some incoming pulled \n> changes.\n> \n> Pulled changes are contextually very far away, so it should be possible \n> to merge them without user interaction.\n> \n> But git still complains:\n> \n> $ git pull\n> Updating 91bfe02..522ccf2\n> error: Your local changes to the following files would be overwritten by \n> merge:\n>      x\n\npull only uses rebase.autoStash if you ask it to rebase, if it is trying \nto merge then you need to pass --autostash on the command line or set \nmerge.autoStash (assuming you want merge to always use --autostash).\n\nBest Wishes\n\nPhillip\n\n> \n> Yuri\n> \n> \n"},{"id":"449343","messageId":"xmqqa6ehtgz5.fsf@gitster.g","threadId":"57432","inReplyTo":"3101d7c2-c78c-1f96-a7c6-08979d8f246b@gmail.com","subject":"Re: When rebase.autoStash=true is used, 'git pull' merge process still complains when incoming changes are in a different place of the file than local changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-02-23T21:23:26Z","receivedAt":"2022-02-23T21:23:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> On 17/02/2022 20:50, Yuri wrote:\n>> I have a file \"x\" that has one local change and some incoming pulled\n>> changes.\n>> Pulled changes are contextually very far away, so it should be\n>> possible to merge them without user interaction.\n>> But git still complains:\n>> $ git pull\n>> Updating 91bfe02..522ccf2\n>> error: Your local changes to the following files would be\n>> overwritten by merge:\n>>      x\n>\n> pull only uses rebase.autoStash if you ask it to rebase, if it is\n> trying to merge then you need to pass --autostash on the command line\n> or set merge.autoStash (assuming you want merge to always use\n> --autostash).\n\nI wonder if it would make a good #leftoverbit starter project to\nintroduce pull.autoStash so that those who want autostash only when\nrunning \"git pull\" (but not \"git merge\" or \"git rebase\") can set it,\nignoring the settings of merge/rebase.autoStash variables.\n\nThanks.\n\n"}]}