gitbutlerapp / gitbutler

The GitButler version control client, backed by Git, powered by Tauri/Rust/Svelte
https://gitbutler.com
Other
13.4k stars 530 forks source link

Support repos with Relative URL remotes #2887

Open gitbutler-client opened 9 months ago

gitbutler-client commented 9 months ago

Hi! I'm trying to use GitButler but it doesn't allow me to setup my repos. I checked the logs and it says it's because Relative URLs. Is there some plan for this to get supported soon?

com.gitbutler.app tail GitButler.log.2024-02-23
2024-02-23T10:07:30.180690Z  INFO get_base_branch_data: gitbutler-app/src/virtual_branches/commands.rs:159: new project_id="f1613649-874a-419b-a69a-8e200796ac4e"
2024-02-23T10:07:30.185961Z  INFO get_base_branch_data: gitbutler-app/src/virtual_branches/commands.rs:159: close time.busy=5.17ms time.idle=123µs project_id="f1613649-874a-419b-a69a-8e200796ac4e"
2024-02-23T10:08:04.512145Z  INFO set_base_branch: gitbutler-app/src/virtual_branches/commands.rs:182: new project_id="f1613649-874a-419b-a69a-8e200796ac4e" branch="origin/master"
2024-02-23T10:08:04.515292Z ERROR set_base_branch: gitbutler-app/src/virtual_branches/errors.rs:636: set base branch error error=failed to get remote url for origin

Caused by:
    remote url error: Relative URLs are not permitted: "codecommit::eu-central-1://<Account>@<repo-name>" project_id="f1613649-874a-419b-a69a-8e200796ac4e" branch="origin/master"
2024-02-23T10:08:04.515352Z  INFO set_base_branch: gitbutler-app/src/virtual_branches/commands.rs:182: close time.busy=3.17ms time.idle=59.0µs project_id="f1613649-874a-419b-a69a-8e200796ac4e" branch="origin/master"
2024-02-23T10:08:04.618427Z  INFO get_base_branch_data: gitbutler-app/src/virtual_branches/commands.rs:159: new project_id="f1613649-874a-419b-a69a-8e200796ac4e"
2024-02-23T10:08:04.626637Z  INFO get_base_branch_data: gitbutler-app/src/virtual_branches/commands.rs:159: close time.busy=8.16ms time.idle=67.8µs project_id="f1613649-874a-419b-a69a-8e200796ac4e"

https://discord.com/channels/1060193121130000425/1210530318625546282/1210530321217355806

Byron commented 1 week ago

The respective code is here:

https://github.com/gitbutlerapp/gitbutler/blob/1fa97d4468a14f48e612b2d9931b2c89194d3e00/crates/gitbutler-url/src/parse.rs#L136-L138

And it seems like some of it was copied from gitoxide back in the days, and portions of it could be relaxed without negative repercussions.