Conversation
|
Please, no. Such ignores belong on the client, as they are client-specific (in this case IDEA and macOS). |
|
I would actually support it strongly. This is a trap that is set for people, and adding configuration in the repo is absolutely no problem. @slawekjaranowski - I am happy to accept such change. This is how most repos that are "contributor friendly" look like nowadays. |
|
More explanation:
Do you think @sebb making it difficult to contribute by casual contributors is a good idea? What are we trading-off with here ? What's the problem you are trying to solve? |
|
Push it again -> apparently the branch has been deleted. |
Two clicks, restore branch and then reopen 😄 |
|
Yeah. I would love to hear more opinions on that one indeed. I have mine, @sebbASF has different - I wonder what others think. |
|
The gitignore file is going to have to include a lot more entries to be certain to catch all spurious files. If committers expect that they will be protected against spurious additions, they are less likely to check. Are you sure that there are no files that we do want to include in the repo but which are also generated by local software? If you truly want to be safe, it seems to me that the way to do this would be to use an allow list, rather than a deny list. i.e. exclude all file types except those known to be needed. This would obviously need to be updated from time to time (but so would a deny list) |
Yes. There are well known patterns that are usually added when you start a repo (usually per language) - even when you create a repo in GH github propopses you add such .gitignore - we could (should) add more here indeed. Here is the collection of commong GitIgnore patterns: https://github.com/github/gitignore We could likely adopt and copy the right ignores for a subset of those.
This is problematic. We do it in Airflow for example for Dockerignore - we exclude everything and add what we want to add explicitly, because that sometime significantly speeds up building container images. because first thing that happens when you build image Docker will have to create and send "context" to the build engine and in case you have generated node modules or other files, that might be multiple GBs (and sometimes 10s of seconds of context preparation). But it causes multiple problems with collaboration because include pattern is far less obvious for people and difficult to reson for, and people are often surprised by it's behaviour. So our .gitignore in airflow is just regular ignoring everything that we do not want. That seems to work well for many projects and in our case comparision of .gitignore and .dockerignore approach is that the default exclusion causes way more confusion. I think it really depends what you want to optimize for. I tend to optimize fore new contributor's experience - make sure that those new contributors have very little surprises and that they are not falling into trap of accidentally committing things they are likely to accidentally commit. And new, casual contributors are more likely than not to use IDEs. What's your optimisation goal @sebbASF ? What do you think will be the goal achieved by not having those ignores? |
|
For ATR we have these additional patterns which if we are being thorough here should be considered: |
|
Yep. @dave2wave Really helpful where you have Python code. It's super annoying (for both maintainers and contributors) to see those committed in the PR and having an extra back-forth when it can be prevented. Especially with the current world of Agent generated contributions, those agents might also generate some of those files accidentally and commit them as part of a PR and having it explicitly defined in .gitignore saves a lot of time, focus on energy on things that might be entirely prevented. |
|
deny lists are inherently unsafe, and will need constant updating, depending on changes to environments outside the control of the repo developers. And every gitignore file in every repo will need updating for each new file. Whereas allow lists only depend on factors totally within the control of the repo developers, and will need fewer updates. Also only the relevant repos will need to be updated. I also don't think it is helpful for users to absolve them of any responsibility for checking what they are committing. If they get used to not bothering to check what they are committing, they may be in for a rude shock when working on a Git repo without some or all of the the ignores that they have become accustomed to. And what about files that are not subject to gitignore but which should not be committed? |
Very generic statement, and quite contrary to comon wisdom among ~50% of
It's not absolving them from responsibity, it's just preventing mistakes when they are easy to prevent and likely to happen. That's a different thing. Also honestly I would prefer my contributor use their decision making pool on deciding whether the change they contribute make sense, rather than havin to remember things that can be automated and people can forget about it.
Of course. And first thing they will do is to propose to add .gitignore -as @slawekjaranowski did with his first commit I guess he just (As I do) run
I am not sure what it has to do with the main point It's a totally differen story - for that we usually use prek hooks, which could be good. I am about to propose it in the future- there are automated tools to prevent secrets, also GitHub has built in scanner (Which we have enabled for all repos) that prevents pushing something that looks like private key or credentials. Just a kind reminder. You still haven't answered my question @sebbASF:
I think understanding where are you coming from and what goal you want to achieve would help us to understand how we can respond to your needs. |
|
An allowlist would add more friction than it removes. I don't think we can name 5 times where people created PRs that included an That said, I also don't see strong a reason to deny this contribution, and we want to encourage people to bring their perspectives and use cases and contribute - for me that'd be reason enough to +1 this PR. |
|
@slawekjaranowski : proposal - maybe you could take a look at those https://github.com/github/gitignore collection and compose a comprehensive list of .gitignore entries that fit the repo and update the PR with it :). That would be probably the best outcome of the discussion. |
How so? I don't follow. |
In https://github.com/github/gitignore we have many examples ... This one contains to many Python releated items |
I already explained how it works in case of Airflow. With Did you see my earlier comment about it @sebbASF ? Was not that enough of an explanation? |
|
Whilst dockerignore and gitignore files both act by filtering resources, the end goals are rather different. A dockerignore file is about excluding resources that are already in the repo. Whereas a gitignore file is about allowing files types that belong in the respository. This is very easy to determine, because the types can readily be extracted from the existing file-set and updated on the rare occasion when a new file type is introduced. |
No description provided.