Bug 507552 - In the projects sidebar, the selectable projects don't include nested git repos depending on the order they were opened in
Summary: In the projects sidebar, the selectable projects don't include nested git rep...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: 22.12.3
Platform: Debian stable Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-27 19:47 UTC by Daniel Abrecht
Modified: 2025-08-04 14:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Projects dropdown, depending on order projects are opened in (28.45 KB, image/png)
2025-07-27 19:47 UTC, Daniel Abrecht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Abrecht 2025-07-27 19:47:42 UTC
Created attachment 183570 [details]
Projects dropdown, depending on order projects are opened in

In the projects sidebar, the selectable projects don't include nested git repos depending on the order they were opened in.  
I have created a git repo, in which I created multiple git workspaces, which have different branches checked out. If I open them in the terminal like so: `kate ./ workspace1/ workspace2/`, workspace1 and workspace2 are not selectable from the projects dropdown.  
But if I open them like this: `kate workspace1/ workspace2/ ./` all 3 git repos are selectable from the dropdown.  
The same thing also happens with git submodules.  
The same thing also happens when opening files using the GUI. If a file from the sub project is opened, before one of the parent project, both appear in the projects dropdown. If it's done the other way around, only the parent project appears.


STEPS TO REPRODUCE
1. Take a git project with nested git repos within, or with submodules
2. Open the child repo before the parent repo: both are in the dropdown
3. Open the parent repo before the child repo: only the parent project is in the dropdown

OBSERVED RESULT
Which projects become available in the projects dropdown depends on the order they are used if they are nested.

EXPECTED RESULT
All used projects should be available in the dropdown.

SOFTWARE/OS VERSIONS
Operating System: Devuan GNU/Linux 5
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Comment 1 Waqar Ahmed 2025-08-04 07:34:23 UTC
Atm, when we encounter a directory or a project file (when creating projects), we check if the directory is a subdirectory of any existing project. If it is, then we just use the parent directory project. This is intentional and desired behaviour as far I can tell. The fact that if you open a child git repo first and then the parent repo, is sort of a "hole"/bug in this behaviour. Think what should happen if you open a file in a child git repo, which project should be activated, the child or the parent.

I work on projects with hundreds of git submodules, it would massively annoying if there were new projects being created for every git submodule that Kate encountered.
Comment 2 Christoph Cullmann 2025-08-04 14:15:42 UTC
Yes, that works as designed, I don't think there is a variant that will make all people happy and I very much prefer the current way of it.