Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GVim as merge tool for TFS

Tags:

merge

vim

I want to use GVim as a merge tool for TFS 2010.
I can't figure out the Arguments for GVim. Specifically the argument %4, when I use it I get an empty buffer for it. if I don't use it I get an error message that I must use it.

enter image description here

like image 335
kroiz Avatar asked Oct 02 '12 13:10

kroiz


1 Answers

This may not be exactly to your liking, but here's how I use GVim for a merge tool.

I set it up to do a two-way merge: it has the 'source' on the left (where I'm merging from), and the merge file on the right (starts off as what my destination branch has for information).

I set it up like this:

command: C:\Program Files (x86)\Vim\vim73\gvim.exe
argument: -c "vert diffsplit %1 " %4 -c "wincmd l|0read %2  |diff"

What this does is as follows:

  • Reads in the 'source' file on the left, and splits the window (-c "vert diffsplit %1")
  • Opens up on the right side the merge result (%4)
  • Runs a quick script which:
    • Moves over the right window (wincmd l)
    • Reads in my existing changes in the branch (0read %2)
    • Re-runs the diff algorithm (diff)

This lets me "diff" my work against the incoming merge, and saving the right hand side will resolve the merge.

like image 60
Eddie Parker Avatar answered Nov 14 '22 13:11

Eddie Parker