Re: [PATCH 1/2] checkout --conflict=<style>: recreate merge in a non-default style
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 1, 2008, 10:39 UTC
- Message-ID
- <7vhc90w3p0.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <48BB9F45.4070509@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
> If --conflict is basically the same as --merge, couldn't we then pass > style argument to --merge or omit it to get the default style?
I originally was thinking about doing it that way, but the option parsing would become somewhat hairly.
$ git checkout --merge=diff3 foo
$ git checkout --merge diff3 foo
$ git checkout --merge diff3The first one is clearly "switch to branch 'foo'; simple 2-way read-tree may find the changes in my working tree conflicting and refuse, so use 3-way merge to resolve such conflicts and express the conflicts in diff3 style".
The third one is "switch to branch 'diff3'; don't barf on conflicting working tree changes; 3-way merge them".
What about the second one? Is it "switch to 'foo', express conflicts in diff3 style", or "checkout path foo from tree-ish diff3"?
It is the former, but that is only because the latter is an error (-m is defined only for checking things out of the index). That is not something parse-options can easily/cleanly do.