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

glide get deletes all comments from glide.yaml #691

Open
dt opened this issue Nov 29, 2016 · 4 comments
Open

glide get deletes all comments from glide.yaml #691

dt opened this issue Nov 29, 2016 · 4 comments

Comments

@dt
Copy link

dt commented Nov 29, 2016

We've found that in practice, when we pin a dependency to a particular version, we like to leave a comment indicating why that version is needed, a link to an upstream issue, etc. next to the explicit version.

It looks like running glide get or one of the glide commands that can edit glide.yaml will however delete all comments.

I'm guessing this is because it parses it -- discarding comments -- then edits the in-memory conf representation before writing the whole thing back out at once, thus deleting the original comments.

@sdboyer
Copy link
Member

sdboyer commented Dec 2, 2016

Yaaaaargghhhh...yes, it's not OK that we do this, and you're exactly right about why it happens. Your particular use case is even one that I've literally recommended - pinning a dep is a rather drastic measure that should be temporary, and come with an explanatory comment.

This is gonna require a wholly different approach to how we write out the config files.

@dt
Copy link
Author

dt commented Dec 2, 2016

looks like upstream has discussed this before: go-yaml/yaml#132

@dt
Copy link
Author

dt commented Dec 2, 2016

Just thinking out loud here: a workaround, without switching to/waiting for a comment-preserving yaml parser, might be to just add a new key comment for a string that is parsed and preserved in the Dependency struct?

@sdboyer
Copy link
Member

sdboyer commented Dec 2, 2016

i'd be open to that. @mattfarina ?

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

2 participants