Jump to content

p4eclipse symbolic links (symlink)

p4eclipse symlink osx unix p4 edit p4 sync

  • Please log in to reply
1 reply to this topic

#1 DevByStarlight



  • Members
  • Pip
  • 4 posts

Posted 15 May 2014 - 07:25 AM



    OSX Mavericks
    Eclipse, Keplar


I use symbolic links (symlink; soft link) in the directory structure of my project. These symlinks reference directories managed by perforce. (Actually, the symlinks themselves are also managed by Perforce as well - although not particularly relevant.)

Given a directory structure of:



				symABC/  @			  --> symlinks to ../Primary/ABC
					(original.txt)	  --> NOT a symlink .. but is in a symlink'd directory

					linkRef_SomeFile.txt  @   --> symlink to ../../Primary/DEF/SomeFile.txt


P4Eclipse interprets "Secondary/symABC" as being its own directory structure. In other words, it accepts the symlink'd path to the file as physical rather than logical. (The "linkRef_SomeFile.txt" is checked in as a symlink)

Therefore, in P4Eclipse, modifying "Secondary/symABC/original.txt" will not trigger a "p4 edit" on the file - ie, it will not check it out.

Apparent reason is P4Eclipse uses the logical path rather than the true physical path to the file when it checks with Perforce to see if it is managed.

Edit and save "Primary/ABC/original.txt" will [naturally] prompt to check out the file. However, the symlink'd version of the file does not display as being checked out. This is more of a cosmetic issue.

The command line tools (p4 sync, edit, etc) exhibit the same behaviour - ie, not only happening in P4Eclipse.

For instance, "p4 edit Secondary/symABC/original.txt" will return a "not in client workspace" ... unless of course it was previously added - in which case it's actually a duplicate of the "original.txt" file.

Request For Comment, Workarounds, and/or Feature Request

It would be beneficial to have an option (eg, checkbox) in the P4Eclipse settings to have it check the true physical path first and, if no match, then treat the symlink'd directory as a "real" directory

For example:
    Eclipse - Workspace Preferences - Team - Perforce
    [checkbox]   "Check physical path to files before treating symlink directories as normal directories"

My current workaround for the command line tools is to use a shell function which takes the basename of the file, uses "pwd -P" to get the true physical path, and redirect that to, say, the "p4 edit" command.

A solution for P4Eclipse would be useful from a day-to-day workflow since there isn't an obvious / convenient workaround. However, it would be nice to have the same feature in the p4 commands as well.


Ironically, as of the 2013.1 release, the fix for another issue was to checkin symlink directories and its conntents (thus treating the symlink directory as a "real" directory). This is good too. However, having an option to check the physical path first would be a good addition as well.

- See also:
    Release Notes for P4Eclipse, the Perforce Plug-in for Eclipse, Version 2013.1
    Coments regarding "Bug #046299"

#2 P4Matt


    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 15 May 2014 - 05:57 PM

I very much appreciate your thorough issue report. I will file these requests, one for P4Eclipse and one for p4, with the respective teams.

Also tagged with one or more of these keywords: p4eclipse, symlink, osx, unix, p4 edit, p4 sync

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users