git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: git@vger.kernel.org
Subject: Re: [StGit PATCH 3/5] Add automatic git-mergetool invocation to the  new infrastructure
Date: Mon, 16 Mar 2009 15:03:09 +0000	[thread overview]
Message-ID: <b0943d9e0903160803y25eb3f45y96d68e734b22e5f9@mail.gmail.com> (raw)
In-Reply-To: <20090313021751.GC15393@diana.vm.bytemark.co.uk>

2009/3/13 Karl Hasselström <kha@treskal.com>:
> On 2009-03-12 12:09:07 +0000, Catalin Marinas wrote:
>>                  # There were conflicts
>> -                conflicts = [l for l in output if l.startswith('CONFLICT')]
>> -                raise MergeConflictException(conflicts)
>> +                if interactive:
>> +                    self.mergetool()
>> +                else:
>> +                    conflicts = [l for l in output if l.startswith('CONFLICT')]
>> +                    raise MergeConflictException(conflicts)
>
> Does the merge tool always resolve all conflicts? If it doesn't, the
> two lines in the "else" branch should probably be run unconditionally.
[...]
>> +        # check for unmerged entries (prepend 'CONFLICT ' for consistency with
>> +        # merge())
>> +        conflicts = ['CONFLICT ' + f for f in self.index.conflicts()]
>> +        if conflicts:
>> +            raise MergeConflictException(conflicts)
>> +        elif err:
>> +            raise MergeException('"git mergetool" failed, exit code: %d' % err)
>
> Ah, you take care of conflicts here too. Hmm. I guess that's fine too,
> though there is some code duplication. Maybe a helper function that
> takes output as a parameter, and raises MergeConflictException if
> necessary?

The non-interactive path assumes that there are conflicts if "git
merge-recursive" returned an error and it simply splits the output if
this command. The mergetool path has to run "git ls-files --unmerged"
to check if there were any left conflicts. I wouldn't call "git
ls-files" in the first case as we already have the information.

-- 
Catalin

  reply	other threads:[~2009-03-16 15:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 12:08 [StGit PATCH 0/5] Various StGit patches Catalin Marinas
2009-03-12 12:08 ` [StGit PATCH 1/5] Check for local changes with "goto" Catalin Marinas
2009-03-13  1:57   ` Karl Hasselström
2009-03-16 14:56     ` Catalin Marinas
2009-03-17  7:06       ` Karl Hasselström
2009-03-17 10:51         ` Catalin Marinas
2009-03-17 13:36           ` Karl Hasselström
2009-03-12 12:09 ` [StGit PATCH 2/5] Add mergetool support to the classic StGit infrastructure Catalin Marinas
2009-03-13  2:02   ` Karl Hasselström
2009-03-12 12:09 ` [StGit PATCH 3/5] Add automatic git-mergetool invocation to the new infrastructure Catalin Marinas
2009-03-13  2:17   ` Karl Hasselström
2009-03-16 15:03     ` Catalin Marinas [this message]
2009-03-17  7:12       ` Karl Hasselström
2009-03-12 12:09 ` [StGit PATCH 4/5] Convert "sink" " Catalin Marinas
2009-03-13  2:27   ` Karl Hasselström
2009-03-12 12:09 ` [StGit PATCH 5/5] Convert "float" to the lib infrastructure Catalin Marinas
2009-03-13  2:41   ` Karl Hasselström
2009-03-16 16:36     ` Catalin Marinas
2009-03-17  7:16       ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0943d9e0903160803y25eb3f45y96d68e734b22e5f9@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).