Skip to content

Commit 42cf301

Browse files
committed
Skip blame-ignored revisions [ci skip]
1 parent e667bb7 commit 42cf301

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tool/lib/vcs.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,23 @@ def changelog_formatter(path, arg, base_url = nil)
524524
proc do |w|
525525
w.print "-*- coding: utf-8 -*-\n"
526526
w.print "\n""base-url = #{base_url}\n" if base_url
527+
528+
begin
529+
ignore_revs = File.readlines(File.join(@srcdir, ".git-blame-ignore-revs"), chomp: true)
530+
.grep_v(/^ *(?:#|$)/)
531+
.to_h {|v| [v, true]}
532+
ignore_revs = nil if ignore_revs.empty?
533+
rescue Errno::ENOENT
534+
end
535+
527536
cmd_pipe(env, cmd, chdir: @srcdir) do |r|
528537
r.gets(sep = "commit ")
529538
sep = "\n" + sep
530539
while s = r.gets(sep, chomp: true)
531540
h, s = s.split(/^$/, 2)
541+
if ignore_revs&.key?(h[/\A\h{40}/])
542+
next
543+
end
532544

533545
next if /^Author: *dependabot\[bot\]/ =~ h
534546

0 commit comments

Comments
 (0)