See also https://stackoverflow.com/q/61423177/841108
I want to git add the [HelpCovid.geany](https://github.com/bstarynk/helpcovid/blob/master/HelpCovid.geany) project file for the GPLv3+ project [helpcovid](https://github.com/bstarynk/helpcovid).
When I manually replace absolute paths there (which are unfriendly to `git`) with relative paths, I am getting lots of messages like
(geany:1819382): Geany-CRITICAL **: 10:43:52.803: utils_tidy_path: assertion 'g_path_is_absolute(filename)' failed
(geany:1819382): Geany-CRITICAL **: 10:43:52.880: utils_tidy_path: assertion 'g_path_is_absolute(filename)' failed
Thanks for all the correct details.
The `*.geany` file is basically a session file, its for recreating a specific users's previous session and settings, its not designed for storing in repositories since it can contain user specific information.
There have been attempts to make project files (which are named sessions) relative, but it appears nobody felt it worth the effort (see #600).
On 4/25/20 11:32 AM, elextr wrote:
Thanks for all the correct details.
The |*.geany| file is basically a session file, its for recreating a specific users's previous session and settings, its not designed for storing in repositories since it can contain user specific information.
There have been attempts to make project files (which are named sessions) relative, but it appears nobody felt it worth the effort (see #600 https://github.com/geany/geany/pull/600).
On Linux at least, a possible way might be to use glob(3) http://man7.org/linux/man-pages/man3/glob.3.html or wordexp(3) http://man7.org/linux/man-pages/man3/wordexp.3.html facilities when parsing that *.geany file.
I am definitely aware that on Windows it is a lot more difficult.
I am coding since 1974, but never used Windows in my life (both at home and at work), and at the age of 60 don't feel it is even worth learning it.
Thanks for your nice reply.
Cheers from near Paris, France.
I don't think its as simple as first thoughts indicate, project files don't get stored in the tree by default, they default to `~/projects`.
My projects are stored on a raid array mounted at `/data` so paths relative to the project file would be something like `../../../../data/what/ever/hello_world.cpp` which won't travel either. You would need to be sure all paths were below the project file.
As you alluded to, Windows could be trickier, I'm not sure `..` will go from `c:` to `d:` nor between two SMB mounted systems `//a/` and `//b/`.
Finally, as I said, projects are basically session files, changes in which files are open get stored in the project file. So if you store it in git it is likely to get stored on every commit or you will likely get "changed but not committed" messages when you do some git things.
There have been various discussions about separating the settings and the session so its cleaner to store project settings in VCS, but no flexible, good, simple, efficient, and easy solution was found.
I don't think its as simple as first thoughts indicate, project files don't get stored in the tree by default..
What is the purpose of `base_path` project setting? It's logical to use it in conjunction with project's source tree. Such that any relative paths referenced in `[files]` would be considered relative to the `base_path`. Of course, other files may be from outer trees, but those could stay absolute.
Btw, why there are `%2F` used instead of actual `/` in file path in `[files]` section?
On 5/6/20 12:25 AM, nomadbyte wrote:
I don't think its as simple as first thoughts indicate, project files don't get stored in the tree by default..
What is the purpose of |base_path| project setting? It's logical to use it in conjunction with project's source tree. Such that any relative paths referenced in |[files]| would be considered relative to the |base_path|. Of course, other files may be from outer trees, but those could stay absolute.
Btw, why there are |%2F| used instead of actual |/| in file path in |[files]| section?
The motivation was to git add and git commit a geany project, that someone else could git clone elsewhere.
Hi,
I really want to have relative path in the geany session file. Being able to deploy code ready to compile with IDE setup is a nice looking idea!
So here is what I suggest:
1. Be able to open file with relative path from the session file. For relative path, the root path would be the one of the "session file" 2. Create a checkbox in the project properties to use relative or absolute path. 3. Be able to save relative path in the session file 4. Deal with the base_path
Right now, I am on the step 1. I have clearly identify were are the path read : function open_session_file, in file keyfile.c I can tell if a path is a relative one or an absolute one.
I am stuck because i didn't find an obvious way to share the absolute path of the session to this function.
Do you have any suggestions or comments?
I am not really interested in solving that issue anymore, since my pet project is [RefPerSys](http://refpersys.org/), and I hope to give a web interface to it.
Hi,
I understant your point, but I am interested in solving that issue. So I would advise you to remove the notification about this issue to avoid the noise ! I don't think it would be a good idea to create a duplicate.
Bien cordialement,
The issue seems complex enough to require several weeks of work and I don't have that much time for it. BTW, you could send me an email in French to basile@starynkevitch.net
github-comments@lists.geany.org