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

Re: -X theirs does not resolve symlink conflict Was: BUG: merge -s theirs is not in effect

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 26, 2017, 01:56 UTC
Message-ID
<xmqqing6cje7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170925143040.4qgofxcdahal46r7@hopa.kiewit.dartmouth.edu>
Yaroslav Halchenko <yoh@onerussian.com> writes:
Show 8 quoted lines
> yes it does. Thanks.  And that is where I realized that I should have used -X
> theirs (not -s theirs), as the instruction on the option for the
> (recursive) merge.  And now problem is more specific:
>
> - conflict within file content editing was resolved as instructed
>   (taking "theirs" version)
>
> - BUT symlink was not taken from "theirs" and left as unresolved conflict:

I wouldn't call it working-as-intended, but this unfortunately is expected. You'd encounter exactly the same behaviour when changes to a binary file conflicts.

It is because -X<ours|theirs> _ONLY_ kicks in (i.e. that is how it is defined) when we would otherwise throw the half-merged result:

	<<<<<<<
	our version looks like this
	=======
	their version looks like this
	>>>>>>>
and ask you to edit that to a correct resolution.

Because you would not normally be given something like the above when merging conflicted changes to symbolic links or to binary files, -X<ours|theirs> has no chance of affecting the outcome.

I do not recall people talking about symbolic links but the case of binary files has been on the wishlist for a long time, and I do not know of anybody who is working on (or is planning to work on) it.

Previous: Yaroslav HalchenkoNext: Junio C Hamano
Message 6 of 19 in “BUG: merge -s theirs is not in effect (does the same as -s ours)”
  1. Yaroslav HalchenkoSep 25, 2017
  2. Junio C HamanoSep 25, 2017
  3. Yaroslav HalchenkoSep 25, 2017
  4. Re* BUG: merge -s theirs is not in effect (does the same as -s ours)Junio C Hamano, Sep 25, 2017
  5. -X theirs does not resolve symlink conflict Was: BUG: merge -s theirs is not in effectYaroslav Halchenko, Sep 25, 2017
  6. Junio C HamanoSep 26, 2017
  7. Junio C HamanoSep 26, 2017
  8. Junio C HamanoSep 26, 2017
  9. Yaroslav HalchenkoSep 26, 2017
  10. merge: teach -Xours/-Xtheirs to symbolic link mergeJunio C Hamano, Oct 16, 2017
  11. Elijah NewrenDec 29, 2017
  12. Yaroslav HalchenkoDec 29, 2017
  13. external diff driver is not used for diff --stat?Yaroslav Halchenko, Jan 25, 2018
  14. -s theirs use-case(s) Was: BUG: merge -s theirs is not in effectYaroslav Halchenko, Sep 25, 2017
  15. Junio C HamanoSep 26, 2017
  16. Yaroslav HalchenkoSep 26, 2017
  17. Junio C HamanoSep 27, 2017
  18. Yaroslav HalchenkoSep 27, 2017
  19. Yaroslav HalchenkoSep 27, 2017

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.