Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can't open submodules as projects #5099

Open
jorge-menjivar opened this issue Oct 11, 2024 · 3 comments · Fixed by #5100
Open

[BUG] Can't open submodules as projects #5099

jorge-menjivar opened this issue Oct 11, 2024 · 3 comments · Fixed by #5100
Assignees
Labels
enhancement An improvement to an existing feature

Comments

@jorge-menjivar
Copy link

jorge-menjivar commented Oct 11, 2024

Version

0.13.0

Operating System

Linux

Distribution Method

AppImage (Linux)

Describe the issue

I want to open and work in a submodule in my repo, but I get "Not a directory (os error 20)" when trying to open a submodule as a project. Opening the main project does not cause this issue.

How to reproduce

Using the cosmic-epoch repo as an example

  1. Clone https://github.com/pop-os/cosmic-epoch.
  2. Init the submodules with git submodule update --init --recursive
  3. Open any of the submodules inside the cosmic-epoch project as a submodule. It will throw the error.

Expected behavior

It should be able to open it (i.e. deal with .git files)

Relevant log output

2024-10-11T04:45:57.632111Z ERROR get_project: crates/gitbutler-project/src/controller.rs:161: failed to create "/home/jorge/rust_projects/cosmic-epoch/cosmic-applibrary/.git/gitbutler" on project get project_id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 error=Os { code: 20, kind: NotADirectory, message: "Not a directory" } id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 no_validation=None
2024-10-11T04:45:57.632145Z  INFO get_project: crates/gitbutler-tauri/src/projects.rs:32: close time.busy=804µs time.idle=47.3µs id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 no_validation=None
2024-10-11T04:45:57.633198Z ERROR set_project_active: crates/gitbutler-project/src/controller.rs:161: failed to create "/home/jorge/rust_projects/cosmic-epoch/cosmic-applibrary/.git/gitbutler" on project get project_id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 error=Os { code: 20, kind: NotADirectory, message: "Not a directory" } id=5bcdae24-6a01-4275-90d7-b9b5671a4a42
2024-10-11T04:45:57.633231Z ERROR set_project_active:set_project_to_window: crates/gitbutler-tauri/src/window.rs:129: error=Not a directory (os error 20) id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 window="main"
2024-10-11T04:45:57.633242Z  INFO set_project_active:set_project_to_window: crates/gitbutler-tauri/src/window.rs:129: close time.busy=19.7µs time.idle=6.48µs id=5bcdae24-6a01-4275-90d7-b9b5671a4a42 window="main"
2024-10-11T04:45:57.633252Z ERROR set_project_active: crates/gitbutler-tauri/src/projects.rs:67: error=Error(Not a directory (os error 20)) id=5bcdae24-6a01-4275-90d7-b9b5671a4a42
2024-10-11T04:45:57.633261Z  INFO set_project_active: crates/gitbutler-tauri/src/projects.rs:67: close time.busy=318µs time.idle=9.24µs id=5bcdae24-6a01-4275-90d7-b9b5671a4a42
@jorge-menjivar jorge-menjivar added the bug Something isn't working label Oct 11, 2024
@Byron Byron self-assigned this Oct 11, 2024
@Byron
Copy link
Collaborator

Byron commented Oct 11, 2024

Thanks a lot for reporting.

I am on it, a PR should be up momentarily.

@jorge-menjivar
Copy link
Author

@Byron Now, when trying to open a submodule on nightly 0.5.794, I get the following:

A git-repository without a `.git` directory cannot currently be added

I am just getting started with gitbutler, so I don't know the whole project state yet.
Does this mean that there is no support for submodules at all?

The .git file in the submodule root dir includes the location of the actual git dir, which may be used to find its location:
gitdir: ../.git/modules/my-submodule

Thanks!

@Byron Byron reopened this Oct 13, 2024
@Byron Byron added enhancement An improvement to an existing feature and removed bug Something isn't working labels Oct 13, 2024
@Byron
Copy link
Collaborator

Byron commented Oct 13, 2024

GitButler currently makes the incorrect assumption that .git is always a directory. This alone would definitely be fixable, however, there would probably be a whole lot of other issues to root out after that.

I have reopened this issue and changed the expectation along with the labelling to basically turn it into: "let's allow this case".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants