8

I am trying to use git p4 on my Linux computer. But there seems to be a problem with git-p4 for some reason. When I run the git p4 command I get:

fatal: git was built without support for git-p4 (NO_PYTHON=1)

Any idea why this message is being displayed? Is there anyway I can fix it?

I am using an Ubuntu distribution with Kernel version 3.11.0.

Thank you in advance.

MaACAn
  • 313
  • 3
  • 9
  • 1
    I think the reason for the message should be fairly self-explanatory - the version of `git` installed was built without support for `git-p4`. To fix it you'll have to install a version of `git` that was compiled with the correct options, or compile it yourself... – twalberg Jul 08 '14 at 18:11
  • @twalberg OK thanks. I got git using '#sudo apt-get install git' so I didn't know what was supported. I'll try to compile a version of git myself. I appreciate your help. – MaACAn Jul 09 '14 at 11:39

3 Answers3

12

You could download the git-p4.py file and move it to the right directory:

wget http://git.kernel.org/cgit/git/git.git/plain/git-p4.py?id=master -O git-p4 && chmod +x git-p4
sudo mv git-p4 /usr/lib/git-core/
dqd
  • 1,501
  • 14
  • 10
4

You can just download the python script and install it somewhere, as described here:

https://git.wiki.kernel.org/index.php/GitP4#Adding_git-p4_to_an_existing_install

I found I had to put git-p4 into /usr/lib/git-core on my Ubuntu system for it to be invoked by git:

$ sudo mv /path/to/git-p4.py /usr/lib/git-core/git-p4

$ git p4 clone //depot/somebranch

(You need to remove the .py file extension).

Or you can just run it by hand (it's just a Python script and has no particular dependencies).

e.g.

$ /path/to/git-p4.py clone //depot/somebranch

The real problem is that the git-p4 Debian package has been removed because it depends on the non-free p4 client. See this bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715534

So creating a non-free or contrib git-p4 debian package would fix this properly.

Luke
  • 589
  • 2
  • 8
2

The version of git included with Ubuntu 14.04 is not compiled with python support. git-p4 is written in python. This version of git includes a shell script called git-p4 that gives you the message.

You can either:

  • Uninstall the binary git package, and compile your own with python support.
  • Get a copy of git-p4 (python) and put it in your $PATH, and delete the shell script git-p4.
Douglas Leeder
  • 52,368
  • 9
  • 94
  • 137