-
Notifications
You must be signed in to change notification settings - Fork 571
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
Respect .gitignore
file in commits
#1868
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! And I agree that this is a bugfix.
The implementation looks good to me.
Thanks for the review @LysandreJik! Failing tests are unrelated so I'll merge this one and fix the CI in a separate PR. |
sorry i'm late to this, but are you sure we even needed a |
My feeling was that in some cases users still want to force upload a file. But yeah, maybe unlikely so I'd be fine with removing it (it has not been released yet so should be ok). |
Opened a PR to remove |
Solves #1826 and follow-up after server-side change (https://github.com/huggingface/moon-landing/pull/8007 - private link).
I have now added a
respect_gitignore: bool = True
parameter tocreate_commit
andupload_folder
to respect the gitignore file, if it exists.By default we check if a .gitignore file is present in the commit itself. Otherwise the one hosted on the Hub is used. Only the gitignore file at root is respected (not in subdirectories).
I have adapted the documentation and added a few tests for it.
Note: as mentioned by @julien-c in #1826 (comment), let's consider this as a "bug-fix" and not a "breaking change" as we can expect that no-one was intentionally uploading ignored files on purpose.