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

Detect modifications in an installed package #161

Open
schomatis opened this issue Mar 6, 2018 · 4 comments
Open

Detect modifications in an installed package #161

schomatis opened this issue Mar 6, 2018 · 4 comments
Assignees

Comments

@schomatis
Copy link
Collaborator

Is there a way to detect if a package installed with gx was modified (e.g., by checking its hash) to fetch it again?

While working on IPFS, I sometimes modify code belonging to another package, a dependency installed with gx, without noticing it. This other package is not tracked by git (unlike IPFS itself when downloaded with go get) and that modification can go unnoticed (until the package version is updated).

From what I understand reading the code, the way to decide to fetch or not a package is to check for its package.json file, would it be possible to extend this logic to check the entire package for modifications? How complicated would that be to implement (for a new user)?

There's another issue (#77) which mentions the inclusion of a gx status tool, but I'm not sure if it would have the same purpose as this use case.

@djdv
Copy link
Contributor

djdv commented Mar 12, 2018

I was wondering this as well, since packages are hashed and reside in a directory of their own hash, I'd imagine you could just rehash the directory, if the hashes match you're not likely modified, if they don't, refetch.

@schomatis
Copy link
Collaborator Author

@whyrusleeping Sorry to bother you again with this but it would be really useful for my workflow as IPFS is a very repo-distributed project. I'm ok with working on the PR, I would just need some advice on how to approach it.

@whyrusleeping
Copy link
Owner

@schomatis the general way we try to work on dependencies in gx is to use gx-go link which links the normal github repo of the code over the top of the hash. That way you can modify the code in git.

Does that solve your issue? If not, we can look at a new command here.

@schomatis
Copy link
Collaborator Author

@whyrusleeping Thanks, I'll give that a try and let you know.

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

No branches or pull requests

3 participants