You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Giulio Troccoli <Gi...@uk.linedata.com> on 2010/11/08 12:52:27 UTC

Use of kdiff3

Lots of people here use either TortoiseMerge or WinMerge for conflict resolution. But now I have a requirement to provide something similar for a Linux platform and I thought of kdiff3.

I there anyone else that uses as well? I have install it but I would like some advice on how to call it. I know it can take two or three files, but I'm not sure why (i.e. what's the difference) and which files to "feed" it with and in what order.

Thanks
Giulio



Linedata Limited
Registered Office: 85 Gracechurch St., London, EC3V 0AA
Registered in England and Wales No 3475006 VAT Reg No 710 3140 03





Re: Use of kdiff3

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Mon, 8 Nov 2010 11:52:27 +0000, /Giulio Troccoli/:

> Lots of people here use either TortoiseMerge or WinMerge for
> conflict resolution. But now I have a requirement to provide
> something similar for a Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but I
> would like some advice on how to call it. I know it can take two
> or three files, but I'm not sure why (i.e. what's the difference)
> and which files to "feed" it with and in what order.

I use KDiff3 to resolve conflicts in conjunction with the 
command-line svn client on Windows (it works really well), by 
specifying a batch (shell) script to the 'merge-tool-cmd' option in 
the "config" file:

http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html#svn.advanced.confarea.opts.config

The script takes care to launch KDiff3 with the appropriate 
arguments which are made available to this wrapper script in some 
predefined order.  See also:

"Using External Differencing and Merge Tools" 
<http://svnbook.red-bean.com/nightly/en/svn.advanced.externaldifftools.html>

"Resolving conflict differences interactively" 
<http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.resolve.resolve>:

> To use a merge tool, you need to either set the SVN_MERGE
> environment variable or define the merge-tool-cmd option in your
> Subversion configuration file (see the section called
> “Configuration Options” for more details). Subversion will pass
> four arguments to the merge tool: the BASE revision of the file,
> the revision of the file received from the server as part of the
> update, the copy of the file containing your local edits, and the
> merged copy of the file (which contains conflict markers). If your
> merge tool is expecting arguments in a different order or format,
> you'll need to write a wrapper script for Subversion to invoke.

-- 
Stanimir

RE: Use of kdiff3

Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
>


Linedata Limited
Registered Office: 85 Gracechurch St., London, EC3V 0AA
Registered in England and Wales No 3475006 VAT Reg No 710 3140 03

-----Original Message-----


> From: Giulio Troccoli [mailto:Giulio.Troccoli@uk.linedata.com]
> Sent: 08 November 2010 11:52
> To: 'Subversion User List'
> Subject: Use of kdiff3
>
> Lots of people here use either TortoiseMerge or WinMerge for
> conflict resolution. But now I have a requirement to provide
> something similar for a Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but
> I would like some advice on how to call it. I know it can
> take two or three files, but I'm not sure why (i.e. what's
> the difference) and which files to "feed" it with and in what order.
>
> Thanks
> Giulio
>

Sorry, I'm RTFM now

RE: Use of kdiff3

Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
>


Linedata Limited
Registered Office: 85 Gracechurch St., London, EC3V 0AA
Registered in England and Wales No 3475006 VAT Reg No 710 3140 03

-----Original Message-----


> From: Giulio Troccoli [mailto:Giulio.Troccoli@uk.linedata.com]
> Sent: 08 November 2010 11:52
> To: 'Subversion User List'
> Subject: Use of kdiff3
>
> Lots of people here use either TortoiseMerge or WinMerge for
> conflict resolution. But now I have a requirement to provide
> something similar for a Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but
> I would like some advice on how to call it. I know it can
> take two or three files, but I'm not sure why (i.e. what's
> the difference) and which files to "feed" it with and in what order.
>
> Thanks
> Giulio
>

Sorry, I'm RTFM now

Re: Use of kdiff3

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Mon, 8 Nov 2010 11:52:27 +0000, /Giulio Troccoli/:

> Lots of people here use either TortoiseMerge or WinMerge for
> conflict resolution. But now I have a requirement to provide
> something similar for a Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but I
> would like some advice on how to call it. I know it can take two
> or three files, but I'm not sure why (i.e. what's the difference)
> and which files to "feed" it with and in what order.

I use KDiff3 to resolve conflicts in conjunction with the 
command-line svn client on Windows (it works really well), by 
specifying a batch (shell) script to the 'merge-tool-cmd' option in 
the "config" file:

http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html#svn.advanced.confarea.opts.config

The script takes care to launch KDiff3 with the appropriate 
arguments which are made available to this wrapper script in some 
predefined order.  See also:

"Using External Differencing and Merge Tools" 
<http://svnbook.red-bean.com/nightly/en/svn.advanced.externaldifftools.html>

"Resolving conflict differences interactively" 
<http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.resolve.resolve>:

> To use a merge tool, you need to either set the SVN_MERGE
> environment variable or define the merge-tool-cmd option in your
> Subversion configuration file (see the section called
> “Configuration Options” for more details). Subversion will pass
> four arguments to the merge tool: the BASE revision of the file,
> the revision of the file received from the server as part of the
> update, the copy of the file containing your local edits, and the
> merged copy of the file (which contains conflict markers). If your
> merge tool is expecting arguments in a different order or format,
> you'll need to write a wrapper script for Subversion to invoke.

-- 
Stanimir

Re: Use of kdiff3

Posted by Campbell Allan <ca...@sword-ciboodle.com>.
On Monday 08 Nov 2010, Giulio Troccoli wrote:
> Lots of people here use either TortoiseMerge or WinMerge for conflict
> resolution. But now I have a requirement to provide something similar for a
> Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but I would like
> some advice on how to call it. I know it can take two or three files, but
> I'm not sure why (i.e. what's the difference) and which files to "feed" it
> with and in what order.
>
> Thanks
> Giulio
>

I've used it from the command line but found I had to fiddle with the file 
options a bit to get them in the right order for a 3 way diff. I recall 
having to explicitly set the merge output file but that may be because I 
messed with the order of files. 

I also use kdiff3 from Kate as an external tool and bound to shift+F12 so I 
can diff the current file in a quick and easy way. The following is the 
script.

cd %directory
if [ -e .svn/text-base/%filename.svn-base ]; then
  tmpfile=/tmp/svndiff-$$.tmp
  svn cat %filename > $tmpfile
  kdiff3 --L1 '%filename base' $tmpfile %filename
  rm $tmpfile
else
  kdialog --title Error --msgbox "The file '%filename' is not in Subversion."
fi



Not sure if you still need this but for completeness and the list archives. 
Two files is usually used to compare current changes against the base 
revision, ie. what have I changed. A three file comparison is for conflict 
resolution where another developer has committed a newer version of the file 
than you are working from and will allow you to easily merge the changes in 
as you can your changes and the other developers changes at the same time. 
It's better to think of it like this, the left file is the original version 
of the file before any changes are made. The right file is the updated file 
in version control and the middle file has your changes but needs to include 
those from the right.

-- 

__________________________________________________________________________________
Sword Ciboodle is the trading name of ciboodle Limited (a company 
registered in Scotland with registered number SC143434 and whose 
registered office is at India of Inchinnan, Renfrewshire, UK, 
PA4 9LH) which is part of the Sword Group of companies.

This email (and any attachments) is intended for the named
recipient(s) and is private and confidential. If it is not for you, 
please inform us and then delete it. If you are not the intended 
recipient(s), the use, disclosure, copying or distribution of any 
information contained within this email is prohibited. Messages to 
and from us may be monitored. If the content is not about the 
business of the Sword Group then the message is neither from nor 
sanctioned by us.

Internet communications are not secure. You should scan this
message and any attachments for viruses. Under no circumstances
do we accept liability for any loss or damage which may result from
your receipt of this email or any attachment.
__________________________________________________________________________________

Re: Use of kdiff3

Posted by Nick Stolwijk <ni...@gmail.com>.
I use the svndiffwrapper[1] script to use SVN cli in combination with
kdiff3. Save the script to ~/bin/ and make it executable. (And make
sure ~/bin is on the path) Then change ~/.subversion/config to include
the lines:

# diff3-has-program-arg = [true | false]
diff-cmd = svndiffwrapper
diff3-cmd = svndiffwrapper

Then it will use the script to execute kdiff3.

[1] http://www.yolinux.com/TUTORIALS/src/svndiffwrapper.txt

Hth,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl



On Mon, Nov 8, 2010 at 12:52 PM, Giulio Troccoli
<Gi...@uk.linedata.com> wrote:
> Lots of people here use either TortoiseMerge or WinMerge for conflict resolution. But now I have a requirement to provide something similar for a Linux platform and I thought of kdiff3.
>
> I there anyone else that uses as well? I have install it but I would like some advice on how to call it. I know it can take two or three files, but I'm not sure why (i.e. what's the difference) and which files to "feed" it with and in what order.
>
> Thanks
> Giulio
>
>
>
> Linedata Limited
> Registered Office: 85 Gracechurch St., London, EC3V 0AA
> Registered in England and Wales No 3475006 VAT Reg No 710 3140 03
>
>
>
>
>

Re: Use of kdiff3

Posted by Bogdan Cristea <cr...@gmail.com>.
On Monday 08 November 2010 13:52:27 Giulio Troccoli wrote:
> Lots of people here use either TortoiseMerge or WinMerge for conflict
> resolution. But now I have a requirement to provide something similar for
> a Linux platform and I thought of kdiff3.
> 
> I there anyone else that uses as well? I have install it but I would like
> some advice on how to call it. I know it can take two or three files, but
> I'm not sure why (i.e. what's the difference) and which files to "feed" it
> with and in what order.
> 
> Thanks
> Giulio
> 
> 
> 
> Linedata Limited
> Registered Office: 85 Gracechurch St., London, EC3V 0AA
> Registered in England and Wales No 3475006 VAT Reg No 710 3140 03

Eclipse has a plugin subclipse with a nice file compare tool. Otherwise, I 
personally choose to use 'svn diff' from command line.