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

Warn in pub publish if git status is not clean #2040

Closed
mklim opened this issue Jan 30, 2019 · 2 comments · Fixed by #4373
Closed

Warn in pub publish if git status is not clean #2040

mklim opened this issue Jan 30, 2019 · 2 comments · Fixed by #4373
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-enhancement A request for a change that isn't a bug

Comments

@mklim
Copy link

mklim commented Jan 30, 2019

Splitting this off from some discussion on flutter/flutter#27258. When we're publishing a package, it's possible to have build artifacts or other untracked/ignored files in the local directory of the package. But by default we only ever want to publish files that are already tracked and committed in git. pub publish does spit out a tree of all the files its planning on publishing already, but in practice this isn't really useful for us since there's so many files in a typical package.

It would be helpful for us if there was a flag or setting where we could tell pub that we're trying to use git as our source of truth, and have it at a bare minimum panic and throw up a warning if the git status isn't clean and/or it's about to upload files that aren't already committed in the source tree.

@jonasfj
Copy link
Member

jonasfj commented Sep 14, 2021

Maybe we should just warn against publishing files that are:

  • tracked in git
  • have changes not committed in git

I think it's always reasonable to warn against tracked files with changes not committed in git.

@sigurdm sigurdm changed the title Feature request: Restrict pub publish to files tracked and unchanged in git Warn in pub publish if git status is not clean Jun 16, 2022
@jonasfj jonasfj added good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-enhancement A request for a change that isn't a bug labels Jun 16, 2022
@jonasfj
Copy link
Member

jonasfj commented Jun 16, 2022

I think this can be implemented as a validator:
https://github.com/dart-lang/pub/tree/master/lib/src/validator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants