Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2019, 07:23 UTC
- Message-ID
- <xmqqsgvp9axu.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CABPp-BHB3c0XqS57Do8=YFtbVyBEe26kbJtgDxWAaWAMzsgdoA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
>> I think sometimes a 3-way merge creates marker conflicts in file, and >> this does not look easy to reverse when switching back. If it's true >> and we can detect it, we can still abort this case (i.e. requiring -m
Paths with actual conflicts are much easier to recover from than paths that cleanly merge. You have your original in stage #2, so you should be able to "restore-path --stage=2 --from-stage path..." them. Once the contents are auto-resolved cleanly, however, the cached contents are automaticaly updated to the auto-resolved result, and it needs more work to reverse the effect of the merge (it is doable, of course, as you know exactly the contents of the switched-to branch and the contents of the switching-from branch, so it is just the matter of running 3-way merge in the right direction to recover what used to be in the working tree).