git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 diff3

The 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.

Previous: Johannes Sixt
Message 3 of 3 in “checkout --conflict=<style>: recreate merge in a non-default style”
  1. 1/2 checkout --conflict=<style>: recreate merge in a non-default styleJunio C Hamano, Sep 1, 2008
  2. Johannes SixtSep 1, 2008
  3. Junio C HamanoSep 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.