Get static code analyzer messages only from 'git diff'?

In our build system (with sources under git version control), I’d like to get the static code analyzer (pylint, in this case) messages for every build. And I want them incremental: in the new build report, only the messages introduced by new commits are shown.

I can easily get the ‘old’ and ‘new’ commits. Then, the general path is to run the analyzer on the ‘new’ commit, and then, for each source code line with a message, find whether that line is new/modified, or if it is intact from the ‘old’ commit. Then, print only messages from new/modified lines.

  • Git strategy for a project with many independent modules
  • Proper way to use git for website development?
  • how to re-order commits in Git non-interactively
  • Git switching between commits
  • How do i sync/update files using git master stored in dropbox among different computers?
  • git fetch fails due to pack-object failure
  • Is there a simpler way of achieving this goal for pylint? Or is there an existing implementation of something similar?

  • read-only git mirror of an svn repository
  • git branching experimental
  • NuGet Automatic Package Restore when using git submodules
  • So Visual Studio officially supports Git now. What does that mean?
  • Git hosting setup that pulls from developers, rejecting broken commits?
  • Is there a VIM Git timeline?
  • One Solution collect form web for “Get static code analyzer messages only from 'git diff'?”

    You can get list of files changed between commits and pass it to pylint then. With github pullrequest workflow it looks like this:

    git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD master) | grep .py | xargs pylint
    Git Baby is a git and github fan, let's start git clone.