applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
654 stars 71 forks source link

Does outdated work for cookbooks where git is used for the source? #101

Closed axsuul closed 12 years ago

axsuul commented 12 years ago

I have a few cookbooks I'm pointing out like so

cookbook 'monit', git: 'https://github.com/axsuul/cookbook-monit'

If I update the version in the cookbook repo (within metadata.rb) and then proceed to run librarian-chef outdated, it doesn't show up. Looking through the source, it appears to git reset --hard each of the git repos in the cache but that's it. No git pull appears to be performed. Is this intended behavior?

yfeldblum commented 12 years ago

To answer the question directly and specifically, this is not currently supported.

The basic purpose of outdated was to list which cookbooks have new releases out.

At any rate, the meaning of outdated for git-sourced cookbooks is a little fuzzy. Does it mean a new version - and if so, how will it discover the new version? Does it mean a new head in the branch?

axsuul commented 12 years ago

A newer version would mean the latest commit's sha1 hash has changed. To get the latest commit's sha1 hash

$ git ls-remote <URL>
axsuul commented 12 years ago

Would you accept a pull request to support this?

yfeldblum commented 12 years ago

Yes.

yfeldblum commented 12 years ago

The implementation should probably do the same first step as is done when updating: fetch all the remotes and then compare the pinned sha to the latest sha in the same ref.

axsuul commented 12 years ago

Cool, thanks for the heads up!

cjerdonek commented 11 years ago

I was also hit by this today when using librarian-chef for the first time. It confused me that librarian-chef outdated didn't recognize that one of my cookbooks wasn't using the latest commit. At the least, the expected behavior of outdated should probably be documented somewhere in this regard. Was this issue meant to be reopened? It seems like @yfeldblum was open to some change.

yfeldblum commented 11 years ago

The original post in this issue is a question, which I answered. So this issue is closed because it is narrow and resolved.

If someone wants to open a related issue on the subject, proposing a change and even offering a patch, that would be cool.