GNU bug report logs - #69220
[PATCH] smerge-mode: add a function to resolve all conflicts in a file

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Sun, 18 Feb 2024 18:24:03 UTC

Severity: wishlist

Tags: patch

Full log


Message #23 received at 69220 <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 69220 <at> debbugs.gnu.org
Subject: Re: bug#69220: [PATCH] smerge-mode: add a function to resolve all
 conflicts in a file
Date: Mon, 19 Feb 2024 15:38:51 +0300
On Mon, 2024-02-19 at 13:33 +0100, Andreas Schwab wrote:
> On Feb 19 2024, Konstantin Kharlamov wrote:
>
> > On Mon, 2024-02-19 at 13:25 +0100, Andreas Schwab wrote:
> > > On Feb 19 2024, Konstantin Kharlamov wrote:
> > >
> > > > 1: Actually, git provides a functional that should work for
> > > > that
> > > > usecase; but in my experience it is more confusing than it's
> > > > useful. It
> > > > is options `--theirs/ours`, i.e. `git checkout --theirs ./` and
> > > > `git
> > > > checkout --ours ./`. But these options are problematic because
> > > > instead
> > > > of resolving conflict in preference of `theirs` or `ours` they
> > > > do a
> > > > complete checkout of the code from either of the branches. I
> > > > can't
> > > > count how many times I was burned by trying to resolve
> > > > conflicts
> > > > with
> > > > these options and then was getting wrong code because together
> > > > with
> > > > the
> > > > conflicting part the options change everything else.
> > >
> > > I think what you actually want is the 'ours'/'theirs' options of
> > > the
> > > merge strategy (available to both the ort and recursive
> > > strategies).
> >
> > Oh, thanks for mentioning, I didn't know! So… how do I use them?
>
>        -X <strategy-option>, --strategy-option=<strategy-option>
>            Pass the <strategy-option> through to the merge strategy.
> This
>            implies --merge and, if no strategy has been specified, -s
> ort.
>            Note the reversal of ours and theirs as noted above for
> the -m
>            option.
>

Sorry, I'm not following.

So, I just created an artificial conflict. Then I get these errors:

    λ git merge -X theirs
    error: Merging is not possible because you have unmerged files.
    hint: Fix them up in the work tree, and then use 'git add/rm <file>'
    hint: as appropriate to mark resolution and make a commit.
    fatal: Exiting because of an unresolved conflict.
    λ git add -u
    λ git merge -X theirs
    fatal: No current branch.




This bug report was last modified 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.