We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 650d243 commit 77967dcCopy full SHA for 77967dc
1 file changed
bin/prohibit-merge-commits.rb
@@ -6,8 +6,9 @@
6
out, _err, status = Open3.capture3("git", "rev-list", "--parents", "#{oldrev}..#{newrev}")
7
if status.success?
8
out.lines.each do |s|
9
- if s.split.size >= 3
10
- STDERR.puts "A merge commit is prohibited."
+ # Allow merge commits in stable branches to preserve history for stable releases
+ if s.split.size >= 3 && !File.basename(refname).match?(/\Aruby_\d+_\d+\z/)
11
+ STDERR.puts "A merge commit is prohibited for #{refname}."
12
exit 1
13
end
14
0 commit comments