6

I'm using git with Kaleidoscope configured as the difftool. It's been working fine for months. It was working a day or two ago as well. Today, when I tried doing a "git difftool", suddenly, git reports

fatal: unable to create temp-file: No such file or directory

Searching around on google suggested that this might be a directory permission problem in the local git repo. But the situation did not improve even after a recursive chown on the git repo.

Git-difftool documentation does not mention where it might be trying to create this temp file. Does anybody have any ideas on how to find this out?

odie
  • 63
  • 1
  • 5
  • What is the value of `$TMPDIR` on your Git server? – VonC Aug 08 '11 at 06:37
  • Good catch! $TMPDIR was set to something crazy "/private/tmp/PKInstallSandbox.W1I4ev/tmp". After a bit of googling, this is apparently an known issue with an installer of an app (TotalTerminal). It did a self update today, but I didn't figure it would actually break something. – odie Aug 08 '11 at 07:05
  • excellent. I have posted an answer with those elements, for more visibility. – VonC Aug 08 '11 at 07:19

1 Answers1

6

As I commented, this kind of message depends usually on the value of the environment variable $TMPDIR.

In the OP's case:

$TMPDIR was set to something crazy "/private/tmp/PKInstallSandbox.W1I4ev/tmp".
After a bit of googling, this is apparently an known issue with an installer of an app (TotalTerminal).
It did a self update today, but I didn't figure it would actually break something.

Restoring $TMPDIR to a "sane" value (like /tmp or other MacOs-specific localtion) should fix the issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • How do you set $TMPDIR to /tmp? – dmackerman Jan 24 '12 at 17:05
  • 1
    @dmackerman depending on your shell, you would write `export TMPDIR=/tmp` in your `.cshrc` for instance, in order for your session to inherit automatically the right value. – VonC Jan 24 '12 at 17:18
  • 1
    I don't think it's a good idea to set it to just "/tmp" as it implies it should be shared by all the users. Then you would get permission problems when two users try to read or write to the same file. Also, by default, "/tmp" is owned by root anyway. By default, it seems OS X set some user-specific folder with a random value such as "/var/folders/e4/xytn52r93F56k0b6646m3d480000gn/D/" – laurent Jan 03 '14 at 07:36
  • @Laurent I agree, you can set $TMPDIR to any value that works for your account and your OS. – VonC Jan 03 '14 at 07:39