isaacs / github

Just a place to track issues and feature requests that I have for github
2.21k stars 129 forks source link

.gitattributes doesn't hide files in pull request #1484

Open sherodtaylor opened 5 years ago

sherodtaylor commented 5 years ago

It would make PR's way more parsable if .gitattributes would hide generated or vendored files in a pull request. Updating node_modules for Javascript or vendor for Go are making our PR's like 100k lines of code changed and hard to review.

https://help.github.com/articles/customizing-how-changed-files-appear-on-github/

node_modules/* linguist-generated=true
vendor/* linguist-generated=true
clarkbw commented 5 years ago

How Is this not working for you?

That config should hide / collapse the generated files from your pull request view. However the collapsed files will be interspersed and that could definitely be improved. Let me know what you’re expecting here.

I also wrote up some extra details here https://medium.com/@clarkbw/managing-generated-files-in-github-1f1989c09dfd

sherodtaylor commented 5 years ago

@clarkbw The problem is that the PR is still not parsable. I'm not sure if this is how it should appear. This is also on github enterprise as well. Only the first 3000 files are loaded and all of them are the node_modules that should be hidden. So my changes are no where to be found.

node_modules/* linguist-generated=true
screen shot 2019-02-11 at 11 49 58 am
clarkbw commented 5 years ago

Ah I see! Thanks for the clarification! That’s something we could address.

sherodtaylor commented 5 years ago

@clarkbw it would be cool if it listed only the changes we made first or collapse the path of the generated or vendored files.

clarkbw commented 5 years ago

If this is happening on enterprise please contact support as well. We need to log that and it helps to build the case and identify needs.

rspechenkin commented 4 years ago

Was there any progress on this issue? It can be quite confusing to see many vendored files in a PR and also when the file count is mixed it is hard to get a sense of how big the actual PR is.

pedromassango commented 3 years ago

Any update guys?

I want to hid all .g.dart anywhere in my project but that does not seems to work:

**/*.g.dart
Levi-Lesches commented 3 years ago

For generated files, I would use .gitignore instead, so that they never even make it into Git in the first place.

This means you may have to generate the code (for example, with flutter pub run build_runner build) when you pull in new changes or clone the repo, but it keeps your repo much cleaner.

pedromassango commented 3 years ago

For generated files, I would use .gitignore instead, so that they never even make it into Git in the first place.

You probably need those generated files if you are using a CI/CD service, unless you want to pay more by adding flutter pub run as a step in the CD/CD workflow!