1

I'm trying to use a shell script and .gitconfig to open up p4merge (on Mac) when diffing files with git.

It's almost working, but I get a problem with the relative path on the "right" file (second file) which is passed to p4merge:

~> git diff <absolute path>/django/templates/pagination.html 
output: 
/<absolute path to prev version>//jtpgjm_pagination.html django/templates/pagination.html
Incorrect parameters: 'django/templates/pagination.html' is (or points to) an invalid file.

The full path is being expanded on the first parameter, but not on the second. Is there something I can do to trigger the full file path for the second file?

mariachimike
  • 1,303
  • 2
  • 17
  • 22

1 Answers1

0

Use this:

readlink -f django/templates/pagination.html

As an argument to command, for example:

echo $(readlink -f django/templates/pagination.html)

ouah
  • 142,963
  • 15
  • 272
  • 331