applicationsonline / librarian

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

error in Cheffile github url wipes local mods and leaves user in anon branch #140

Closed bluekelp closed 11 years ago

bluekelp commented 11 years ago

(verified this is present in latest librarian-chef gem available via "gem install librarian-chef --pre" also)

if user enters a :github => URL for a repo as https://github.com/owner/repo instead of owner/repo and runs librarian-chef update the tool fails with this message:

No metadata file found for aws from https://github.com/http://github.com/owner/repo#master! If this should be a cookbook, you might consider contributing a metadata file upstream or forking the cookbook to add your own metadata file.

the local index has been reset, local mods lost (even those staged via add), and the owning project's branch switched to an anonymous/headless branch (e.g., from master). i was unable to figure out how to recover my lost changes.

e.g., my project, foo, is in git and contains a chef/ dir which contains the Cheffile and its managed cookbooks/ dir. the foo repo is the one being messed up by the typo in the Cheffile.

cmur2 commented 11 years ago

I stumbled into this too because of a silly typo in my Cheffile.

The behavior of librarian-chef (local index reset, local changes lost, branched switched into nirwhana) is NOT acceptable! A nice error message explaining what gone wrong where would be helpful but no destructive operation in the parent repository librarian-chef has nothing to do with!

I'm using librarian (0.0.26).

yfeldblum commented 11 years ago

Should be fixed in https://github.com/applicationsonline/librarian/commit/dfc57c20e3a782365a458bff563c1ced85eeaa8e.