Binary test file is treated as valid contributions, giving +400000 lines of code in pull request. #5164
-
Preliminary StepsPlease confirm you have...
Problem DescriptionI'm pushing large binary test file to the repository, which should not be detected as code contribution. Test file is located at URL of the affected repository:PR: rnpgp/rnp#1378 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
No it's not. It's reporting "changes": ... which is not necessarily the number of lines changed and also has nothing to do with Linguist, so anything Linguist related in the It's important to remember that you're essentially looking at a nice friendly web view of $ git clone -q [email protected]:rnpgp/rnp.git
$ cd rnp
$ git switch ni4-oss-fuzz-26318-out-of-memory
Switched to branch 'ni4-oss-fuzz-26318-out-of-memory'
Your branch is up to date with 'origin/ni4-oss-fuzz-26318-out-of-memory'.
$ git diff master -- src/tests/data/test_fuzz_verify_detached/clusterfuzz-testcase-minimized-fuzz_verify_detached-5749353995829248 | head -6
diff --git src/tests/data/test_fuzz_verify_detached/clusterfuzz-testcase-minimized-fuzz_verify_detached-5749353995829248 src/tests/data/test_fuzz_verify_detached/clusterfuzz-testcase-minimized-fuzz_verify_detached-5749353995829248
new file mode 100644
index 00000000..d9e8e5c4
--- /dev/null
+++ src/tests/data/test_fuzz_verify_detached/clusterfuzz-testcase-minimized-fuzz_verify_detached-5749353995829248
@@ -0,0 +1,408016 @@ <--- 🎉 HERE'S THE SOURCE OF YOUR BIG FIGURE
$ And now you know a little more about how diffs work on GitHub and where that figure comes from 😀 |
Beta Was this translation helpful? Give feedback.
-
Thanks for spending your time to answer! From the documentation I read I got a feeling that Linguist is also responsible for detecting which files are included in diff and which are ignored. Do you have any hint on how to ignore some files on user contributions calculation? I.e. for 3 years I've got only +128k changes on the repository 'Contributors' page, and do not want to add +400k on top of this :-) |
Beta Was this translation helpful? Give feedback.
-
Linguist can only be used to suppress files shown in the diff (ie show all the lines or show the "Load diff" message) or ignore them when determining the language breakdown of a repo. It can't be used to completely ignore files being changed and I don't believe there is any way of suppressing the count on the contributions page as you really did make those changes at the git repo level. This is a side effect of committing large binary files to a repo. |
Beta Was this translation helpful? Give feedback.
-
@lildude Thanks again. Strangely, even force-setting |
Beta Was this translation helpful? Give feedback.
No it's not. It's reporting "changes":
... which is not necessarily the number of lines changed and also has nothing to do with Linguist, so anything Linguist related in the
.gitattributes
will have no effect at all.It's important to remember that you're essentially looking at a nice friendly web view of
git diff
in the "Files changed" tab of a PR and that's where the number of "changes" comes from as we can see if we look at the diff using git alone: