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

Re: BUG: merge -s theirs is not in effect (does the same as -s ours)

From
Yaroslav Halchenko <yoh@onerussian.com>
Date
Sep 25, 2017, 03:17 UTC
Message-ID
<20170925031751.lg7zk6krt65dxwas@hopa.kiewit.dartmouth.edu>
In-Reply-To
<xmqqwp4nfuv1.fsf@gitster.mtv.corp.google.com>
On Mon, 25 Sep 2017, Junio C Hamano wrote:
> Yaroslav Halchenko <yoh@onerussian.com> writes:
Show 5 quoted lines
> > My interest was to get remote branch "merge" the changes in the
> > branch taking the branch's version (primarily alternative symlinks
> > for git-annex'ed content) over the version in master (previous
> > merge of a similar branch).  Unfortunately -s theirs seems to do
> > actually -s ours
> What does
>     ls $(git --exec-path) | grep git-merge

NB when running git just built, --exec-path reports some non existing dir in ~:

$> git --exec-path /home/yoh/libexec/git-core $> ls -l /home/yoh/libexec/git-core ls: cannot access '/home/yoh/libexec/git-core': No such file or directory $> which git /home/yoh/proj/misc/git/git

> say?  
> The official Git never shipped "git-merge-theirs" as far as I know,
> and it should not exist (neither should "git merge -s theirs"; you
> can use "git reset --hard theirs" instead).

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:

MERGE STRATEGIES
       The merge mechanism (git merge and git pull commands) allows the backend merge strategies to be chosen with -s option. Some strategies can also take their own options, which can be passed by giving -X<option>
       arguments to git merge and/or git pull.
       ...
       recursive
           This can only resolve two heads using a 3-way merge algorithm. When there is more than one common ancestor that can be used for 3-way merge, it creates a merged tree of the common ancestors and uses that as
           the reference tree for the 3-way merge. This has been reported to result in fewer merge conflicts without causing mismerges by tests done on actual merge commits taken from Linux 2.6 kernel development
           history. Additionally this can detect and handle merges involving renames. This is the default merge strategy when pulling or merging one branch.
           The recursive strategy can take the following options:
           ours
               This option forces conflicting hunks to be auto-resolved cleanly by favoring our version. ...
           theirs
               This is the opposite of ours.
(Documentation/merge-strategies.txt in the sources I guess)
PS thanks for CCing me in 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 3 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.