Allow using relative paths when specifying local repositories#48
Open
reuvenpo wants to merge 2 commits into
Open
Allow using relative paths when specifying local repositories#48reuvenpo wants to merge 2 commits into
reuvenpo wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to
pluglocal git repositories using relative paths, e.g.: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 toplugis not changed, which is the reason for the multiple../in the example path. The git clone command is run fromres://.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
truepassed to_executein the diff was added to allow me to debug this problem in the first place, as the stderr output fromgit clonewas not being propogated up in any way. Thetruethere allowed me to see the issue when runninggd-plugwith debug printing enabled.With this change,
git clonestill 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.clonemethod 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)