I just went through a cleanup and organization of my Desktop as it was getting a bit messy. Part of that mess was the number of TM Project files that started to collect there. I decided to put them in a folder and then drag the folder to the Dock so I could get a popup of the contents, the same as the Documents and Downloads folder.
After I did this I found that that Textmate would open, but the contents where in red coloring and not available to me. After some looking I found that files contained the path to my files relative to where the Projects file was created. I thought that at this point it would be faster to simply edit the files in Terminal with vi rather than re-create everything, and also better since I would retain all the settings that were embedded.
As a test on one of them I changed the path from a relative path (../ Sites/foldername) to an absolute one (/Users/myname/Sites/foldername) and it opened everything the way I expected. But after I closed the project in Textmate, I found that the path had once again reverted to relative again (../../Sites/foldername). I ended up changing a dozen or more files anyway, and now all is good, but I can't imagine what the effort would have been if I had many, many projects.
So I guess I am wondering why this is the behavior, and why Textmate can't use an absolute path which would make management of the Project files a lot easier. And before someone asks, I do a lot of online testing of different installations and I like having direct access to the Projects without having to navigate to them in the Finder and finding them in the actual folder name. I also don't have the Project file(s) cluttering up my site files either.
On Mar 29, 2010, at 8:13 PM, BarryW wrote:
So I guess I am wondering why this is the behavior, and why Textmate can't use an absolute path which would make management of the Project files a lot easier.
If it used absolute paths and someone tried to move both the project and the directory together, they would see that all the files went red and wonder why it didn’t just use relative paths. :)
Sometimes developers just have to pick one way, knowing that it could potentially cause problems for people doing it the other way. I guess Alan went with the people that keep project files together with their directories.
I believe this will all be different in TM2, but since there are no official features announced, I can’t say for sure.
On Mar 30, 6:37 am, Rob McBroom mailingli...@skurfer.com wrote:
If it used absolute paths and someone tried to move both the project and the directory together, they would see that all the files went red and wonder why it didn’t just use relative paths. :)
Thanks for the answer here, but it's not really the correct one.
If you create the project file in the directory you are managing, then the string for the sourceDirectory will contain nothing, and Textmate, I assume, will just use the current directory for the contents. That is what allows you to move both your directory and the project file around without breaking it.
When you save the project file in a separate location, it then populates the string with the relative path.
Thanks - Barry
On 2010-03-30, at 4:39 PM, BarryW wrote:
If it used absolute paths and someone tried to move both the project and the directory together, they would see that all the files went red and wonder why it didn’t just use relative paths. :)
Thanks for the answer here, but it's not really the correct one.
If you create the project file in the directory you are managing, then the string for the sourceDirectory will contain nothing, and Textmate, I assume, will just use the current directory for the contents. That is what allows you to move both your directory and the project file around without breaking it.
When you save the project file in a separate location, it then populates the string with the relative path.
The behaviour could be there for people like me, who have all the managed directories in subfolders, and save the project files in the parent folder. However, I only ever move the parent folder, containing all subfolders.
-----Original Message----- From: textmate-bounces+dru=summitprojects.com@lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com@lists.macromates.com] On Behalf Of Jan Jakob Bornheim Sent: Tuesday, March 30, 2010 1:52 PM To: TextMate users Subject: [TxMt] Re: Why relative paths and not absolute in project files?
On 2010-03-30, at 4:39 PM, BarryW wrote:
If it used absolute paths and someone tried to move both the project and the directory together, they would see that all the files went red and wonder why it didn't just use relative paths. :)
Thanks for the answer here, but it's not really the correct one.
Just thought I'd chime in with an observation. I was just curious where these strings you mention were, and started poking around the tmproj file (I never realized it was just plist!). I opened up two different tmproj files, and saw that I happened to open one with files on my Mac, and one with files on a server. The one with local files has relative paths, but the one on the server (and I would assume other volumes) had absolute paths.
I'm just observing...not sure what to do with that tidbit of information, but just thought someone could use that to their advantage. Maybe if you really wanted absolute paths, make sure you save your tmproj to a different volume? Then you could move it whereever you wanted? Maybe? Just a thought.
+dru