Skip to content

Allow using relative paths when specifying local repositories#48

Open
reuvenpo wants to merge 2 commits into
imjp94:masterfrom
reuvenpo:patch-1
Open

Allow using relative paths when specifying local repositories#48
reuvenpo wants to merge 2 commits into
imjp94:masterfrom
reuvenpo:patch-1

Conversation

@reuvenpo

@reuvenpo reuvenpo commented Oct 15, 2025

Copy link
Copy Markdown

This PR adds the ability to plug local git repositories using relative paths, e.g.:

plug("../my_repo/.git", {"tag": "my-version"})

This change is introduced because the file:// "protocol" supported by git clone requires absolute paths, which are not practical when working in a team, with certain closed source repositories.

With the current implementation, the path provided to plug is not changed, which is the reason for the multiple ../ in the example path. The git clone command is run from res://.plugged/my_repo, so ../../ takes us back to the project directory (which is not obvious or documented outside of code). A more intuitive implementation could be to add ../../ to the user provided path in this context.
EDIT: I went ahead and changed that and pushed new commits. The relative path is now relative to the project directory.

The true passed to _execute in the diff was added to allow me to debug this problem in the first place, as the stderr output from git clone was not being propogated up in any way. The true there allowed me to see the issue when running gd-plug with debug printing enabled.

With this change, git clone still issues a warning about certain flags being ignored when installing this way, but I don't think that that's a big issue.

While I'm here, I'll point out that the _GitExecutable.clone method does not (always) return the same "type" as the other methods in that class. (specifically its happy path, on the last line, does not return the {"exit", "output"} object)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant