-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow to ignore files during diff generation #18814
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
Conversation
This is interesting 👍 Could you please add testing to verify it behaves as intended? |
Well... The problem with testing at the moment is pretty much that what I mentioned in |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
argsLength += len(files) + 1 | ||
argsLength += len(files) | ||
|
||
// git 1.9.0 added pathspec exclusion of files |
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.
Now the minimal git version is 2.0, so version check is unnecessary.
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.
Yep, true.
I'd still like to add some tests before allowing this PR to be merged.
However, I'm still unsure how to do that in this case:
I know there are former git repositories in our codebase that are used for testing somehow, but I have no idea how or where to add tests.
I'll fix it when I add the tests as well.
@delvh are you working on it? |
Not really |
Going forward, this PR allows us to ignore certain files while generating diffs.
While the functionality is currently unused, I intend to use it in a follow-up PR in the next days/ weeks to implement viewing files in a PR.I could also postpone this PR and then post all changes at once in the other PR (once it's ready).
The "other PR" is #19007 and was implemented without this functionality.
As it is thematically isolated and decreases the size of the other PR (it will likely become large), I would like to merge this now.
Once both PRs are merged, we can hopefully see a huge performance boost for PRs with large files that have already been viewed by the user.
I currently know of one problem and of one potential problem that need to be answered before merging this PR:
1. How should the ignored files be reported? Because with the proposed approach, they will simply be missing in the output, which is understandable, but not really user-friendly. Is there an inexpensive way to get all information stored in theDiffFile
struct from git?Not a problem as I only had the use case for #19007 in mind which was now implemented without it.
2. How are the git commands executed? In particular, will the quoting (
''
) be problematic on Windows systems? I don't have a Windows system at hand right now, so it would be good if someone else could confirm this.