monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] xxdiff "save as merged"


From: Nathaniel Smith
Subject: Re: [Monotone-devel] xxdiff "save as merged"
Date: Tue, 16 May 2006 02:26:52 -0700
User-agent: Mutt/1.5.11

On Tue, May 16, 2006 at 01:06:00AM -0400, Martin Blais wrote:
> On 5/16/06, Derek Scherger <address@hidden> wrote:
> >Cool! And thanks for the great merge tool, it's the preferred choice by
> >many of us here.

Indeed, it's quite nice, and definitely the most solid tool I've
tried.  (I actually like emacs's emerge better just because, hey,
emacs, but when hammered on it turns out to have bugs... I've never
had xxdiff just lose track of what's going on and turn everything into
a giant conflict.)

> Then you will be happy to learn that the upcoming 3.2 version will
> include a lot of fresh Python code to write wrapper scripts around
> xxdiff.  This will make it *really easy* to write scripts that invoke
> it for specific developing processes.  All the old scripts have been
> refactored to use this new infrastructure, and since I now use
> Subversion a lot, new svn scripts have been written, tested and are
> included as well.   These should form good examples to write analogue
> scripts for Monotone.  Feel free to have a look, for example, at
> xx-svn-diff:

Hmm, I'm not sure what this actually means; we just have some script
compiled into monotone so it knows how to run xxdiff appropriately,
and the interface I see is that I run a merging command in monotone,
and up pops xxdiff.

Since we've got you here ;-), what I'd love to see in xxdiff is some
way to take some matching lines, and tell the tool to pretend that no,
really, they're unmatching lines.

The use case is something like (using --- to mark edges of files)

---
2006-05-12  Nathaniel Smith  <address@hidden>

        * monotone.texi: Re-sync the two copyright blocks.
---

versus

---
2006-05-12  Nathaniel Smith  <address@hidden>

        * ChangeLog: fix whitespace.
---

Here xxdiff of course notices that the first two lines are the same,
and give me a conflict on the last line.  Normally for conflicts like
this I use "s" to take both hunks and put them sequentially into the
output file, but here that doesn't work... the result would be:

---
2006-05-12  Nathaniel Smith  <address@hidden>

        * monotone.texi: Re-sync the two copyright blocks.
        * ChangeLog: fix whitespace.
---

But I want:

---
2006-05-12  Nathaniel Smith  <address@hidden>

        * monotone.texi: Re-sync the two copyright blocks.

2006-05-12  Nathaniel Smith  <address@hidden>

        * ChangeLog: fix whitespace.
---

And this would be easy if I could add the two leading lines to the
conflict hunk, if that makes sense.

The other similar case is even more annoying:
---
2006-05-12  Nathaniel Smith  <address@hidden>

        * monotone.texi: Re-sync the two copyright blocks.

2006-05-12  Nathaniel Smith  <address@hidden>
                                            
        * ChangeLog: fix whitespace.        
---
2006-04-08  Matthew Gregan  <address@hidden>

        * monotone.cc: Oops, needed to include
        boost/filesystem/convenience.hpp too.

        * monotone.cc (cpp_main): Exclude .exe extension by using
        fs::basename rather than path.leaf().
---
Here, it will sometimes sync up on the empty line in the middle!  So
the second file ends up as two separate conflict hunks with one shared
line in the middle, and there's nothing to be done.  If I could turn
it into one larger hunk, all would be well.

I guess a meta-point here is that it would be really nice to be able
to edit the files in place, for arbitrary resolutions, like e.g.
emerge allows :-).  But 95% of the cases where I need this are covered
by the case above.

Thanks again for such a handy tool!
-- Nathaniel

-- 
.i dei jitfa fanmo xatra




reply via email to

[Prev in Thread] Current Thread [Next in Thread]