2

I have used meld to merge the conflicted files in git for a long time while running on Ubuntu. Now I need to merge files, but my environnement has changed. I now use a PC on Windows 7, and connects to a CentOS server using Putty. I installed meld on the server :

Package meld-1.3.1-2.el6.noarch already installed and latest version

I tried even to install meld for windows on my PC... it doesn't help. When running :

git mergetool -t meld

Here's the response :

Merging the files: gagglon/v4/www/includes/php/test.php
Normal merge conflict for 'gagglon/v4/www/includes/php/test.php':
{local}: modified
{remote}: modified
Hit return to start merge resolution tool (meld):
Traceback (most recent call last):
File "/usr/bin/meld", line 61, in <module>
import gtk
File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
_init()
File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
_gtk.init_check()
RuntimeError: could not open display
gagglon/v4/www/includes/php/test.php seems unchanged.
Was the merge successful? [y/n] n
merge of gagglon/v4/www/includes/php/test.php failed

What can I do to get meld back, or could you help me find another tool I could use that would be also easy to use like meld ? Any easy interface would do...

Thanks ahead !

2
  • 1
    Is it a DISPLAY environment variable issue, as in bugzilla.redhat.com/show_bug.cgi?id=591502?
    – VonC
    Commented Oct 13, 2013 at 15:43
  • I didn't even knew what were environnment variable ^^ Yet a printenv command doesn't show any DISPLAY variable, even after fresh launching of a terminal... Commented Oct 13, 2013 at 16:11

1 Answer 1

1

On CentOS, most of the threads I found insist on the importance of setting properly the environment variable $DISPLAY.

Noticed that there DISPLAY environment variable was gone in that terminal session.
Opening new terminal session or use different terminal session solves the problem...

export DISPLAY=":1.0"

But on putty, is is harder, as explained in this thread:

All the system-config commands are designed to be ran via X11 (a Linux GUI).
From the error messages its trying to run gtk commands which means its trying to open a GUI window, which is not going to happen via putty.
I would look for other commands to setup what your trying to do.

Why wouldn't you use meld on Windows directly?

With putty only, you can try this solution, based on X11 forwarding:

https://i.sstatic.net/Vpiko.jpg

That means:

  • installing an X11 server on Windows, like XMing,
  • don't forget the fonts: yum install xorg-x11-font*.
13
  • Very interesting, thank you, I read the same thread earlier but didn't understand all of this... I have installed Meld on Windows, but the git is installed on the server and using git mergetool on the server won't trigger a software running on the local machine, I guess... I could be wrong, but if so I didn't find how to. This said, I'm a little confuse, what help would bring to set the display variable by following the X11 forwarding solution ? Commented Oct 13, 2013 at 19:06
  • 1
    @JeremyBelolo it would declare the Windows display for the X11 of your Centos to use.
    – VonC
    Commented Oct 13, 2013 at 19:27
  • 1
    @JeremyBelolo maybe "localhost" isn't properly interpreted. Try that tutorial to see if it works better: math.umn.edu/systems_guide/putty_xwin32.html
    – VonC
    Commented Oct 14, 2013 at 8:28
  • 1
    @JeremyBelolo that X11 server should include fonts (mentioned in stackoverflow.com/a/5812485/6309)
    – VonC
    Commented Oct 14, 2013 at 12:00
  • 1
    @JeremyBelolo great! I have added the two steps (X11 server and fonts) in the answer for more visibility.
    – VonC
    Commented Oct 14, 2013 at 12:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.