<p></p>
<p><b>@elextr</b> requested changes on this pull request.</p>

<p>Not reviewed in detail yet.</p>
<p>This capability needs to be documented in the manual, including downsides and risks such as accidentally storing all files you have open in git and broadcasting that to the world.  New settings not documented either.</p><hr>

<p>In <a href="https://github.com/geany/geany/pull/2667#discussion_r527245889">src/keyfile.c</a>:</p>
<pre style='color:#555'>>  
        if (ft == NULL) /* can happen when saving a new file when quitting */
                ft = filetypes[GEANY_FILETYPES_NONE];
 
-       locale_filename = utils_get_locale_from_utf8(doc->file_name);
+       /* project_root_folder contain a path only if the project use relative path */
+       if(project_root_folder){
+               file_root_folder = g_file_new_for_path(project_root_folder);
+               file_doc = g_file_new_for_path(doc->file_name);
+               relative_filename = g_file_get_relative_path(file_root_folder, file_doc);
+               if(relative_filename){
+                       /* Append './' so we know it is a relative filename */
+                       doc_filename = g_strconcat("./",relative_filename, NULL);
</pre>
<p>As <code>relative_filename</code> is in locale encoding technically you don't know if <code>./</code> is properly encoded to prepend (not append)</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2667#discussion_r527246236">src/keyfile.c</a>:</p>
<pre style='color:#555'>>  
        if (ft == NULL) /* can happen when saving a new file when quitting */
                ft = filetypes[GEANY_FILETYPES_NONE];
 
-       locale_filename = utils_get_locale_from_utf8(doc->file_name);
+       /* project_root_folder contain a path only if the project use relative path */
+       if(project_root_folder){
+               file_root_folder = g_file_new_for_path(project_root_folder);
+               file_doc = g_file_new_for_path(doc->file_name);
+               relative_filename = g_file_get_relative_path(file_root_folder, file_doc);
+               if(relative_filename){
+                       /* Append './' so we know it is a relative filename */
+                       doc_filename = g_strconcat("./",relative_filename, NULL);
+               }else{
+                       doc_filename = g_strconcat(doc->file_name, NULL);
</pre>
<p>Why are you concating nothing?</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2667#discussion_r527251386">src/project.c</a>:</p>
<pre style='color:#555'>> @@ -611,6 +618,10 @@ static void show_project_properties(gboolean show_build)
        gtk_entry_set_text(GTK_ENTRY(e.patterns), entry_text);
        g_free(entry_text);
 
+       gtk_toggle_button_set_active(
+               GTK_TOGGLE_BUTTON(ui_lookup_widget(e.dialog, "checkbutton_project_dialog_file_relative")),
</pre>
<p>Didn't you lookup this widget above? Can't you use that pointer.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2667#discussion_r527252668">src/keyfile.c</a>:</p>
<pre style='color:#555'>> @@ -1218,6 +1242,21 @@ static gboolean open_session_file(gchar **tmp, guint len)
        unescaped_filename = g_uri_unescape_string(tmp[7], NULL);
        locale_filename = utils_get_locale_from_utf8(unescaped_filename);
 
+       /* is the locale_filename absolute or relative ? */
+       if(g_path_is_absolute(locale_filename) && root_folder)
+       {
+               geany_debug("Absolute path");
+       }
+       else
+       {
+               geany_debug("Relative path %s, root folder %s", locale_filename, root_folder);
+               gchar *absolute_path;
+               absolute_path = g_strconcat(root_folder, &(locale_filename[1]), NULL);
</pre>
<p>What if the path is relative, but <code>root_folder</code> is null?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2667#pullrequestreview-534908936">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4CMXD4TE2GGEVWML3SQWNYFANCNFSM4T3NLZQQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ6MAR7OLPTLAMQ5QXDSQWNYFA5CNFSM4T3NLZQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOD7RBACA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2667#pullrequestreview-534908936",
"url": "https://github.com/geany/geany/pull/2667#pullrequestreview-534908936",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>