[Geany] relative paths in project files: is there an option?

Stephan Beal sgbeal at xxxxx
Tue Jun 28 18:17:47 UTC 2011


On Tue, Jun 28, 2011 at 7:52 PM, Dimitar Zhekov <dimitar.zhekov at gmail.com>wrote:

> I remember such a discussion taking place some time ago. It was not so
> straightforward - for example, what about the files not under the
> project directory?


There shouldn't _be_ any files not under the project dir, at least not
managed by the project management tool. IDEs are almost exclusively used for
working on source-control-based projects, and every source tree is rooted in
one directory.


> Store /var/log/foo as [../]{N times}/var/log/foo? Or,
> for files in a nearby directory, break them each time you copy the
> project and open it from the new location? (Well the last operation is
> dangerous currently - you'll be working on the previous files.)
>

That's what happened to me. The file i edited happened to be in the "opened"
list in the project file, and the "wrong" one was opened when i checked out
my second copy. It was just bad luck that /var/www happens to belong to my
user account on that machine (so that i can check out the website from svn -
we don't actually edit anything under that tree). If i had been on a system
i didn't maintain myself, the error would have been caught when i tried to
save (and it couldn't write).

i understand and appreciate the subtle problems involved, as i've had the
same issues before in my own software, but it can (and has) been done. Use
the project file's directory as the root and simply strip that part from all
paths in the project file. Project files are, almost without exception,
stored in the top level of the source tree. If they're not, they should be.
It's just good manners and its where new project members/casual viewers
expect to find them. Just like the 'configure' script and makefile.

The current behaviour fails miserably if i rename/move a directory or end up
on a machine with a different user name (i.e. different path to my project
file). Geany won't be able to find anything. If the paths are relative, such
a change is transparent to the user.


It would have been nice to store anything under the project directory
> as relative, and everything outside as absolute, but some of the
> developers opposed even to that, can't remember why. There was also
> talk about storing each filename as both relative and absolute, and try
> to open the relative first. I thought that was implemented, but don't
> see it anywhere. So, for now, what you see in the title is what you get.


i really appreciate the detailed response. :)

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20110628/06603bd1/attachment.html>


More information about the Users mailing list