Option to automatically skip/filter out files based on status of git
See original GitHub issueWith the use of
git diff --name-only --diff-filter=[AM] HEAD
One can get a list of all files that have either been added (A) or modified (M) since the last commit. There are more flags if one would like to have another default behaviour.
But with the help of this its easy to generate a skipfile that ignores all but those file.
With this we could introduce a new feature lets say “–git-filter” that would automatically ignore all files not changed by the user since the last commit.
CodeChecker check -n "name" --git-filter -l log
This could cut down the analysis time by a large factor when dealing with small/medium commits in a large codebase.
Next level would be if it was possible to ignore all but the lines changed. I will do a similar thing for the setup for my thesis job, but figured I should post it here so we can have a discussion.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
I think I have the ultimate solution!
What about a script that “touch” all of the files that were added or modified. After the modification date is changed the next make command will only rebuild the files that we need to analyze. This way we can achieve incremental analysis.
@Xazax-hun That is indeed a great solution! And even though a file is added or modified its already touched its good with a script like this in case a user does several incremental analysis before commiting. With a script one could make sure that all files since last commit that has changed always are analyzed, not only the ones since the last build.
But even simply using this: CodeChecker -n “name” -b “make platform”
Shuold give you a poor mans incremental analysis.
Then the questions is at what point this is faster than using a logfile and analyzing everything.