From: Catalin Marinas <catalin.marinas@arm.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Unresolved issues #3
Date: Fri, 18 Aug 2006 09:54:03 +0100 [thread overview]
Message-ID: <tnx1wre4e6s.fsf@arm.com> (raw)
In-Reply-To: <7vpseyelcw.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 17 Aug 2006 21:09:03 -0700")
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
Junio C Hamano <junkio@cox.net> wrote:
> * Martin Langhoff proposed git-xxdiff as a helper after a failed
> merge.
>
> Message-ID: <11546492331601-git-send-email-martin@catalyst.net.nz>
>
> I like the general idea of this a lot, but am having a bit of
> trouble envisioning how we can integrate this while making
> sure mergers other than xxdiff can be added easily without
> disrupting the end user experience.
In StGIT I can configure the merge command and I currently use the
attached script (I need to add it to the StGIT repository). It tries
diff3 first and, if that fails, invokes emacs' merge (can use xxdiff
as well). It also checks whether the file was modified in case I want
to exit and solve the conflict later (maybe after getting conflict
information for the other files).
--
Catalin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: merge-interactive.py --]
[-- Type: text/x-python, Size: 1950 bytes --]
#!/usr/bin/env python
"""Run diff3 and an interactive tool if this fails.
"""
__copyright__ = """
Copyright (C) 2006, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
import sys, os
if len(sys.argv) != 5:
print >> sys.stderr, 'Usage: %s ancestor branch1 branch2 output' \
% sys.argv[0]
sys.exit(1)
ancestor = sys.argv[1]
branch1 = sys.argv[2]
branch2 = sys.argv[3]
output = sys.argv[4]
# default merger
if os.system('diff3 -L current -L ancestor -L patched -m -E '
'"%s" "%s" "%s" > "%s"'
% (branch1, ancestor, branch2, output)):
# interactive merge
if os.path.exists(output):
mtime = os.path.getmtime(output)
else:
mtime = 0
ret = os.system('emacs --eval \'(ediff-merge-files-with-ancestor '
'"%s" "%s" "%s" nil "%s")\''
% (branch1, branch2, ancestor, output))
#ret = os.system(
# 'xxdiff --title1 current --title2 ancestor --title3 patched '
# '--show-merged-pane -m -E -O -X -M "%s" "%s" "%s" "%s"'
# % (output, branch1, ancestor, branch2))
# error in the interactive merger, just exit
if ret:
sys.exit(2)
# check for file modification
if not os.path.exists(output) or mtime == os.path.getmtime(output):
sys.exit(3)
# everything's fine
sys.exit(0)
next prev parent reply other threads:[~2006-08-18 8:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-18 4:09 Unresolved issues #3 Junio C Hamano
2006-08-18 4:49 ` A Large Angry SCM
2006-08-18 14:49 ` Nicolas Pitre
2006-08-18 14:56 ` A Large Angry SCM
2006-08-18 15:30 ` Nicolas Pitre
2006-08-19 4:04 ` A Large Angry SCM
2006-08-20 23:10 ` Nicolas Pitre
2006-08-20 23:26 ` Junio C Hamano
2006-08-21 4:05 ` A Large Angry SCM
2006-08-18 5:10 ` Jeff King
2006-08-18 8:54 ` Catalin Marinas [this message]
2006-08-18 9:26 ` Junio C Hamano
2006-08-18 9:56 ` Catalin Marinas
2006-08-18 8:56 ` Jakub Narebski
2006-08-18 16:40 ` Aneesh Kumar K.V
2006-08-18 16:48 ` Jakub Narebski
2006-08-18 17:03 ` Aneesh Kumar K.V
2006-08-18 17:09 ` Jakub Narebski
2006-08-18 17:57 ` Jon Loeliger
2006-08-20 22:17 ` Junio C Hamano
2006-08-21 2:09 ` [PATCH] daemon: prepare for multiple services Junio C Hamano
2006-08-21 2:09 ` [PATCH] daemon: add upload-tar service Junio C Hamano
2006-08-23 23:19 ` Unresolved issues #3 Martin Langhoff
2006-08-25 21:22 ` Jakub Narebski
2006-10-06 6:26 ` Unresolved issues #4 Junio C Hamano
2006-10-06 10:56 ` Jakub Narebski
2006-10-06 16:11 ` Shawn Pearce
2006-10-06 16:04 ` Jon Loeliger
2006-10-06 16:12 ` Shawn Pearce
2006-10-06 16:53 ` A Large Angry SCM
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=tnx1wre4e6s.fsf@arm.com \
--to=catalin.marinas@arm.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.