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

Add option to update one dependency #44

Closed
kfish opened this issue Sep 15, 2017 · 4 comments
Closed

Add option to update one dependency #44

kfish opened this issue Sep 15, 2017 · 4 comments

Comments

@kfish
Copy link

kfish commented Sep 15, 2017

When I work on a project which consists of both a library and a program in separate git repos, a common workflow is to:

  1. add a feature to the library, commit and push it
  2. run elm-install in the program dir, to update the dependency
  3. use the new feature

However, step 2 takes a long time, because elm-install checks all the dependencies for updates. I specifically know that my own library has updated, and I am really only interested in updating that.

Would it be possible to add an option to check for updates for a specific dependency?

In the meantime, is there a quick way I can emulate this (eg. doing a 'git fetch' in ~/.elm-install/..., then a git checkout in elm-stuff/packages)?

@gdotdesign
Copy link
Owner

This a complex issue which I don't really know how to resolve.

Basically there is a cache of git repositories in ~/.elm-install/, we can use that cache to install the dependencies. The question is when to invalidate the cache, but there are several ways that the repository can be used:

  • by version
  • by referencing a tag / branch or specific commit (refs)

We could just compare the versions of the remote with our local ones using git ls-remote which is somewhat faster (not much) than git fetch (which happens now), this would work for the versions but not for refs. That's why every repository is updated every time.

So the ideal solution to speed it up would be a quick (even dirty) was of checking if a local repository is different from the remote, but I'm not aware of any that would do it.


The other way to go is to have some option / action:

  1. --skip-updates - this would just use the cache or clone if not found
  2. update-package user/package - this would fetch the given package directly
  3. --update-only user/package - this would only update the given package

I'm in favor of 1. and 2. so it would go something like this:

elm-install update-package user/package && em-install --skip-updates

For your use case you could to use the directory option so you can use both locally when developing and only push versions when necessary.

@gdotdesign
Copy link
Owner

Also this issue might affect your install time: #42

@gdotdesign
Copy link
Owner

gdotdesign commented Sep 20, 2017

I've implemented 1. and 3. form above, so now you can use: elm-install --only-update elm-lang/core

Released as 1.6.0

@kfish
Copy link
Author

kfish commented Sep 20, 2017

Awesome, thanks!

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

No branches or pull requests

2 participants