Perforce: Linux-based 3-way merge / permission tool?

I am looking for a Linux merge / resolution tool with three methods using Perforce. I am familiar with vim / vimdiff, but I do not know how / if they can be used to merge the three methods. In any case, let me know what you think is the best merge / resolution tool on Linux.

For clarity, let me add that I would prefer a tool that does not require the use of an X server, that is, it can be used through putty.

+4
source share
4 answers

I prefer meld . It is powerful but lightweight and does not have a KDE depot like Kdiff3. View official homepage

+4
source

If you're dead, if you're not using the X client, try looking at emacs ediff . This works in text mode (although it is easier in X).

+4
source

I think you are talking about file resolution in a three-way diff tool. Different versions:

  • ORIGINAL
  • THEM
  • YOUR

Now this will require a little tweaking on Linux. I have a .p4config file that defines my preferred diff tool.

 P4CLIENT=mywork P4DIFF=diff -u P4EDITOR=vi P4IGNORE=.p4ignore 

Here P4DIFF set to diff -u . For all this to work, the .p4config file must be connected to perforce using an environment variable.

 export P4CONFIG=.p4config 

Now this is a sweet spot. We really need to run the p4 resolve command.

 p4 resolve /path/to/mysource.h 

As soon as we do this, it shows that there is a conflict, because someone modified the original version that we worked on. Therefore, it prompts us to action.

 /path/to/mysource.h - merging //stream/version/path/to/mysource.h#2 Diff chunks: 13 yours + 2 theirs + 0 both + 1 conflicting Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: d 

We can see diff by pressing d .

 --- /path/to/mysource.h 2016-09-28 18:34:54.918709150 -0400 +++ /path/to/tmp.6365.102 2016-09-29 11:05:32.228946564 -0400 @@ -16,6 +16,7 @@ we are same in all branches same as everywhere + added line more same @@ -28,7 +29,12 @@ here you go the conflict +>>>> ORIGINAL //stream/version/path/to/mysource.h#1 + the original line is here +==== THEIRS //stream/version/path/to/mysource.h#2 + their line is here +==== YOURS /path/to/mysource.h my line is here +<<<< Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: e 

Now you can correct this entry e . He will open an editor where we can compare different versions between the lines +==== and +<<<< .

Once we finish editing, we can accept by typing a .

 Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) ae: a 

The whole process can be performed from the remote command / shell window. Thus, an X server is not needed.

+3
source

I have something called diff3 that has a merge option. I do not know where it came from, and I did not use it. diff3 -m file1 file2 file3 . Take it for what it costs.

Btw, I am running OpenSuSE 11.2 if this helps.

+1
source

Source: https://habr.com/ru/post/1343603/


All Articles