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

check for different urls when running haxelib git #640

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

ninjamuffin99
Copy link
Contributor

Currently running haxelib git it doesn't check the differences in remote urls.

Running haxelib git flixel https://github.com/HaxeFlixel/flixel.git will correctly install flixel. However, if you then try running with a different url haxelib git flixel https://github.com/FunkinCrew/flixel.git it doesn't properly update / reinstall from the new URL. Going into the cloned repo flixel/git and running git config --get remote.origin.url will show https://github.com/HaxeFlixel/flixel.git rather than the new one.

This PR runs a check from the currently installed haxelib's git remote to the newly inputted one, and if it's different, it will ask if you want to install the new one.

Right now I just have it implemented for git, not mecurial. Current implementation is agnostic to whether someone has an SSH remote url (git@github.com:HaxeFlixel/flixel) or HTTP remote url (https://github.com/HaxeFlixel/flixel)

src/haxelib/api/Vcs.hx Outdated Show resolved Hide resolved
@skial skial mentioned this pull request Aug 21, 2024
1 task
@ninjamuffin99
Copy link
Contributor Author

how was this one looking? Should I add tests for this?

@tobil4sk
Copy link
Member

how was this one looking? Should I add tests for this?

Yes please, a test would be useful!

ninjamuffin99 and others added 6 commits August 29, 2024 15:33
It only has to be checked when running interp scripts, so we can avoid
checking it in other cases.
…ion#638)

* submodule stuff in progress

* perhaps a submodule fix?

* revert the dipshit logging

* update run.n

* we dont need to spit out every log, but we should use the threads?

* comment out the unneeded git fetch

* small reorder / remove redundant `git submodule init`

* uncomment the lib deletion, since we've ran into issues related

* fix for stderr/stdout related hangs on non-windows when installing git submodules

* remove git progress code

* run.n

* remove whitespace

* proper non-cli coupled logging

* remove unneeded logging/git --quiet flag code for the time being

* run.n

* remove unneeded FsUtils.deleteRec()

* run.n

* remove testing print

* run.n

* removed unused import and throw an exception on submodule error

* add message for SubmoduleError
…cal or not

testing in progress

accident git thingie
@ninjamuffin99
Copy link
Contributor Author

finally got around to figuring out how to draft up a test!

I wrote it in TestInstaller.hx rather than TestGit.hx since the url checking logic was in Installer.hx.


if (url != null && libUrl != null && url != libUrl)
{
if (!userInterface.confirm('Update remote url: "${libUrl}" with "${url}"')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new cli interaction that wasn't present before, it may be best to simply overwrite unless there are uncommitted changes.

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.

2 participants