提交 e33608d8 编写于 作者: S Saverio Miroddi

Made commit cherry-pick message more standard

Follow the `cherry pick -x` format for the first line, and the
interactive rebase format for the commits in the merge, in case
of merge commit
上级 3d7febc0
......@@ -252,27 +252,24 @@ class Commit
end
def cherry_pick_description(start_branch_name)
if merge_commit?
message_buffer = ""
message_buffer = "(cherry picked from commit #{sha})"
if merge_commit?
compare = CompareService.new(project, sha).execute(project, start_branch_name)
*commits_in_merge, merge_commit = compare.commits
message_buffer << "cherry picked from merge #{merge_commit.sha}"
# Ignore the merge commit.
commits_in_merge = compare.commits[0..-2]
if commits_in_merge.present?
message_buffer << "; commits:"
message_buffer << "\n"
commits_in_merge.each do |commit_in_merge|
message_buffer << "\n- #{commit_in_merge.sha}"
message_buffer << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}"
end
end
message_buffer
else
"cherry picked from commit #{sha}"
end
message_buffer
end
def cherry_pick_message(start_branch_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册