| Summary: | Adding project files with "list" results in absolute tree paths | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | kde |
| Component: | application | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph |
| Priority: | NOR | ||
| Version First Reported In: | 25.08.3 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/utilities/kate/-/commit/2ea2d5b01f6d6782af15b0cdea043b98a43df903 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
I think just removing that works only because that .env is toplevel in the projects but would fail if one has more nested stuff, but I could be wrong. Reading the code again, you seem to be right and I no longer understand why it was done that way, will need to look at file history. A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1960 Git commit 0fc159c521d37e98fd463020aaf4c8affe1987f9 by Christoph Cullmann. Committed on 12/12/2025 at 14:36. Pushed by cullmann into branch 'master'. make the files relative to current dir later code requires that don't assume nobody wrote or generated absolute paths into the file M +3 -4 addons/project/kateprojectworker.cpp https://invent.kde.org/utilities/kate/-/commit/0fc159c521d37e98fd463020aaf4c8affe1987f9 Git commit 2ea2d5b01f6d6782af15b0cdea043b98a43df903 by Waqar Ahmed, on behalf of Christoph Cullmann. Committed on 24/12/2025 at 18:06. Pushed by waqar into branch 'release/25.12'. make the files relative to current dir later code requires that don't assume nobody wrote or generated absolute paths into the file (cherry picked from commit 0fc159c521d37e98fd463020aaf4c8affe1987f9) M +3 -4 addons/project/kateprojectworker.cpp https://invent.kde.org/utilities/kate/-/commit/2ea2d5b01f6d6782af15b0cdea043b98a43df903 |
SUMMARY I want to add the .env file to the project which is normally ignored via .gitignore: { "name": "test", "files": [ { "list": [ ".env" ] }, { "git": 1 } ] } OBSERVED RESULT This adds the file with it's full path to the tree instead of its relative path, like the files from git. EXPECTED RESULT The tree entry should be relative to the project dir. ADDITIONAL INFORMATION The code has an explicit comment, that an absolute path is needed: https://github.com/KDE/kate/blob/9f7021ea1425f9a306097e97c6d7fbb640b8aa6f/addons/project/kateprojectworker.cpp#L411-L418 But I think this is not correct any more, the filesFromGit function produces relative paths (git ls-files) and the absolute paths are calculated later in https://github.com/KDE/kate/blob/9f7021ea1425f9a306097e97c6d7fbb640b8aa6f/addons/project/kateprojectworker.cpp#L319 Just removing the loop seems to fix the problem.