diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-06-07 20:34:26 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2025-06-07 20:48:08 +0900 |
commit | 42cf301254d4bfec30c07a221f34f3fa85a29f33 (patch) | |
tree | 9ff37e550511a8fc5af503b24732cd95294f3222 /tool/lib | |
parent | e667bb70cfae9a890d52526c3f884cb586236ad3 (diff) |
Skip blame-ignored revisions [ci skip]
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/vcs.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 9734f10532..2c019d81fd 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -524,11 +524,23 @@ class VCS proc do |w| w.print "-*- coding: utf-8 -*-\n" w.print "\n""base-url = #{base_url}\n" if base_url + + begin + ignore_revs = File.readlines(File.join(@srcdir, ".git-blame-ignore-revs"), chomp: true) + .grep_v(/^ *(?:#|$)/) + .to_h {|v| [v, true]} + ignore_revs = nil if ignore_revs.empty? + rescue Errno::ENOENT + end + cmd_pipe(env, cmd, chdir: @srcdir) do |r| r.gets(sep = "commit ") sep = "\n" + sep while s = r.gets(sep, chomp: true) h, s = s.split(/^$/, 2) + if ignore_revs&.key?(h[/\A\h{40}/]) + next + end next if /^Author: *dependabot\[bot\]/ =~ h |