question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to automatically skip/filter out files based on status of git

See original GitHub issue

With 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:open
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Xazax-huncommented, May 19, 2016

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.

0reactions
AlexTeloncommented, Jun 17, 2016

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recording Changes to the Repository - Git SCM
The main tool you use to determine which files are in which state is the git status command. If you run this command...
Read more >
git-status Documentation - Git
When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal ), to help you avoid...
Read more >
2.2 Git Basics - Recording Changes to the Repository
Checking the Status of Your Files. The main tool you use to determine which files are in which state is the git status...
Read more >
git-diff Documentation - Git
Show only names and status of changed files. See the description of the --diff-filter option on what the status letters mean. Just like...
Read more >
Interactive Staging - Git SCM
In this section, you'll look at a few interactive Git commands that can help you craft your commits to include only certain combinations...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found