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

Ignoring Files when Publishing - gitignore doesn't work #2786

Closed
TheHighriser opened this issue Dec 1, 2020 · 3 comments · Fixed by #2787
Closed

Ignoring Files when Publishing - gitignore doesn't work #2786

TheHighriser opened this issue Dec 1, 2020 · 3 comments · Fixed by #2787
Labels
type-enhancement A request for a change that isn't a bug

Comments

@TheHighriser
Copy link

I have searched through the issues already and I don't find anything. Either I am doing something completely wrong or this wasn't used by anyone.

I am trying to exclude certain things from publishing. So e.g. I am trying to exclude the folder "pleaseIgnoreMe/". So I will enter "pleaseIgnoreMe/" into the .gitignore file. When doing a publish --dry-run, I can still see the folder "pleaseIgnoreMe". I then tried to do a normal publish, because I though maybe this is not working for --dry-run and exclude a folder which was not needed and it still is not working. The published artifact has "pleaseIgnoreMe".

The documentation says the only way is the .gitignore file (https://dart.dev/tools/pub/publishing#what-files-are-published). Is this working for anybody?

@isoos
Copy link
Collaborator

isoos commented Dec 1, 2020

@sigurdm sigurdm transferred this issue from dart-lang/pub-dev Dec 3, 2020
@sigurdm sigurdm added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 3, 2020
@sigurdm
Copy link
Contributor

sigurdm commented Dec 3, 2020

Yeah this seems broken. Played a bit with this.
I think the .gitignore is only respected for files not already checked in.

we should be able to use git check-ignore --no-index

@sigurdm
Copy link
Contributor

sigurdm commented Dec 7, 2020

After thinking more about this - we cannot use the .gitignore file for this. If a file is already checked in, then .gitignore should not count for that. We should not change the semantics of that. For example if a user has ignored '*.tmp' files in .gitignore, but has checked a single 'test.tmp' file in to the test suite, it would be surprising that pub does not publish that file.

Therefore I started working on a pubignore file that will allow ignoring files for publishing only: #2787.

@sigurdm sigurdm added feature-request and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Dec 7, 2020
@sigurdm sigurdm added type-enhancement A request for a change that isn't a bug and removed feature-request labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants