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

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

From
Yaroslav Halchenko <yoh@onerussian.com>
Date
Sep 25, 2017, 14:30 UTC
Message-ID
<20170925143040.4qgofxcdahal46r7@hopa.kiewit.dartmouth.edu>
In-Reply-To
<xmqqmv5je412.fsf_-_@gitster.mtv.corp.google.com>
On Mon, 25 Sep 2017, Junio C Hamano wrote:
> Yaroslav Halchenko <yoh@onerussian.com> writes:
> > d'oh, indeed there is no git-merge-theirs  neither in debian pkg or a freshly
> > built git  and I found a rogue script in the PATH (which did nothing
> > apparently, sorry!). BUT I was originally mislead by the --help/manpage:
> Ahh, you're right.  The text does make readers expect "-s theirs" to
> exist.
> ...
>  * I hope this should help things a bit.

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:
$> rm -rf /tmp/repo1; mkdir /tmp/repo1; cd /tmp/repo1; git init .; ln -s sym1 link; echo 1 > file; git add file link; git commit -m 'common'; git co -b b1 ; ln -sf b1link link; echo "b1 file" >| file; git commit -m 'b2 changes' -a; git co master; ln -sf masterlink link; echo "master file" >| file; git commit -m 'also modified in master' -a; git merge -X theirs --no-edit b1; ls -l link; cat file
warning: templates not found /home/yoh/share/git-core/templates
Initialized empty Git repository in /tmp/repo1/.git/
[master (root-commit) f0b75bc] common
 2 files changed, 2 insertions(+)
 create mode 100644 file
 create mode 120000 link
Switched to a new branch 'b1'
[b1 45c93ca] b2 changes
 2 files changed, 2 insertions(+), 2 deletions(-)
Switched to branch 'master'
[master 0ee6db2] also modified in master
 2 files changed, 2 insertions(+), 2 deletions(-)
Auto-merging link
CONFLICT (content): Merge conflict in link
Auto-merging file
Automatic merge failed; fix conflicts and then commit the result.
lrwxrwxrwx 1 yoh yoh 10 Sep 25 10:21 link -> masterlink
b1 file
changes on filesystem:                                                                                          
 link | Unmerged
cached/staged changes:
 file | 2 +-
 link | Unmerged

PS I will followup on -s theirs in a split thread PSS Thanks for CCing me your replies

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 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.