Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55719

Allow to configure the git blame command to suppress whitespace changes

      Sometimes the git blame command does not find the right person as there were whitespace changes (e.g. due to formatting) or code was moved. In this case it is possible to use "git blame -w -M" to suppress commits that only contain those changes and get better results

      I suggest to make the used git blame command configurable.

       

      There are two possible places:

      1. in the global configuration.
      2. in the warnings step itself.

      As the implementation in the global settings is much easier I guess it could be done there. The only reason not to have it there would be to have different settings for different parsers (e.g. if you have one parser in the job that would be sensitive to whitespace changes).

          [JENKINS-55719] Allow to configure the git blame command to suppress whitespace changes

          Till Steinbach created issue -

          Ulli Hafner added a comment -

          I think it would make sense to provide that as part of the IssuesRecorder then it can be adapted for each job.

          Ulli Hafner added a comment - I think it would make sense to provide that as part of the IssuesRecorder then it can be adapted for each job.
          Ulli Hafner made changes -
          Assignee Original: Ulli Hafner [ drulli ]
          Labels New: help-wanted

          Yes, I agree. This would allow maximum flexibility. For me this would be an ideal solution

          Till Steinbach added a comment - Yes, I agree. This would allow maximum flexibility. For me this would be an ideal solution
          Ulli Hafner made changes -
          Component/s New: git-forensics-plugin [ 25321 ]
          Component/s Original: warnings-ng-plugin [ 24526 ]
          Ulli Hafner made changes -
          Labels Original: help-wanted New: help-wanted newbie-friendly
          Ulli Hafner made changes -
          Rank New: Ranked lower

          Since newer versions of git allow one to ignore specific sha's (Reference), perhaps this could be opened up to allowing arbitrary `git blame` arguments?

          Probably out-of-scope for this issue and requires a new issue, but for Git 2.23 and forward, maybe add configuration options specifically for `-ignore-rev` and `-ignore-revs-file`.

          Timothy Brackett added a comment - Since newer versions of git allow one to ignore specific sha's ( Reference ), perhaps this could be opened up to allowing arbitrary `git blame` arguments? Probably out-of-scope for this issue and requires a new issue, but for Git 2.23 and forward, maybe add configuration options specifically for `- ignore-rev` and ` -ignore-revs-file`.

          I like brackett_tcs approach, I guessed that it should already work by setting the config option  "git config blame.ignoreRevsFile .git-blame-ignore-revs" to my file. On the console in the workspace this works, unfortunately it makes no difference for the forensics plugon. Is that a shortcoming of jgit?

          Till Steinbach added a comment - I like brackett_tc s approach, I guessed that it should already work by setting the config option  "git config blame.ignoreRevsFile .git-blame-ignore-revs" to my file. On the console in the workspace this works, unfortunately it makes no difference for the forensics plugon. Is that a shortcoming of jgit?

          Ulli Hafner added a comment -

          I'm not sure if I understand your comment. Did you actually change the code of the git-forensics plugin? Or where did you set this option?

          Ulli Hafner added a comment - I'm not sure if I understand your comment. Did you actually change the code of the git-forensics plugin? Or where did you set this option?

            Unassigned Unassigned
            tstein Till Steinbach
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: