Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
48ba1f4c
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
48ba1f4c
编写于
4月 14, 2020
作者:
A
Alexander Kuzmenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simple changelog script
上级
a7bf6ad6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
5 deletion
+28
-5
utils/simple-backport/changelog.sh
utils/simple-backport/changelog.sh
+22
-4
utils/simple-backport/format-changelog.py
utils/simple-backport/format-changelog.py
+6
-1
未找到文件。
utils/simple-backport/changelog.sh
浏览文件 @
48ba1f4c
...
...
@@ -3,8 +3,9 @@ set -e
from
=
"
$1
"
to
=
"
$2
"
log_command
=(
git log
"
$from
..
$to
"
--first-parent
)
git log
"
$from
..
$to
"
--first-parent
>
"changelog-log.txt"
"
${
log_command
[@]
}
"
>
"changelog-log.txt"
# NOTE keep in sync with ./backport.sh.
# Search for PR numbers in commit messages. First variant is normal merge, and second
...
...
@@ -14,11 +15,18 @@ find_prs=(sed -n "s/^.*Merge pull request #\([[:digit:]]\+\).*$/\1/p;
s/^.*back[- ]*port[ed of]*#
\(
[[:digit:]]
\+\)
.*
$/
\1
/Ip;
s/^.*cherry[- ]*pick[ed of]*#
\(
[[:digit:]]
\+\)
.*
$/
\1
/Ip"
)
"
${
find_prs
[@]
}
"
"changelog-log.txt"
|
sort
-rn
>
"changelog-prs.txt"
"
${
find_prs
[@]
}
"
"changelog-log.txt"
|
sort
-rn
|
uniq
>
"changelog-prs.txt"
echo
"
$(
wc
-l
<
"changelog-prs.txt"
)
PRs added between
$from
and
$to
."
if
"
${
log_command
[@]
}
"
--oneline
--grep
"Merge branch '"
|
grep
''
then
# DO NOT ADD automated handling of diamond merges to this script.
# It is an unsustainable way to work with git, and it MUST be visible.
echo
Warning: suspected diamond merges above.
echo
Some commits will be missed, review these manually.
fi
function
github_download
()
{
local
url
=
${
1
}
...
...
@@ -39,6 +47,7 @@ function github_download()
fi
}
rm
changelog-prs-filtered.txt &> /dev/null
||
:
for
pr
in
$(
cat
"changelog-prs.txt"
)
do
# Download PR info from github.
...
...
@@ -51,6 +60,13 @@ do
continue
fi
# Filter out PRs by bots.
user_login
=
$(
jq
-r
.user.login
"
$file
"
)
if
echo
"
$user_login
"
|
grep
"
\[
bot
\]
$"
>
/dev/null
then
continue
fi
# Download author info from github.
user_id
=
$(
jq
-r
.user.id
"
$file
"
)
user_file
=
"user
$user_id
.json"
...
...
@@ -61,9 +77,11 @@ do
>
&2
echo
"Got wrong data for user #
$user_id
(please check and remove '
$user_file
')."
continue
fi
echo
"
$pr
"
>>
changelog-prs-filtered.txt
done
echo
"### ClickHouse release
$to
FIXME as compared to
$from
"
>
changelog.md
./format-changelog.py changelog-prs.txt
>>
changelog.md
./format-changelog.py changelog-prs
-filtered
.txt
>>
changelog.md
cat
changelog.md
utils/simple-backport/format-changelog.py
浏览文件 @
48ba1f4c
...
...
@@ -30,6 +30,11 @@ def parse_one_pull_request(item):
i
+=
1
if
i
>=
len
(
lines
):
break
# Can have one empty line between header and the category itself. Filter it out.
if
not
lines
[
i
]:
i
+=
1
if
i
>=
len
(
lines
):
break
category
=
re
.
sub
(
r
'^[-*\s]*'
,
''
,
lines
[
i
])
i
+=
1
elif
re
.
match
(
r
'(?i)^\**\s*(Short description|Change\s*log entry)'
,
lines
[
i
]):
...
...
@@ -91,7 +96,7 @@ def print_category(category):
user_name
=
user
[
"name"
]
if
user
[
"name"
]
else
user
[
"login"
]
# Substitute issue links
pr
[
"entry"
]
=
re
.
sub
(
r
'
#([0-9]{4,})'
,
r
'[#\1](https://github.com/ClickHouse/ClickHouse/issues/\1
)'
,
pr
[
"entry"
])
pr
[
"entry"
]
=
re
.
sub
(
r
'
([^[])#([0-9]{4,})'
,
r
'\1[#\2](https://github.com/ClickHouse/ClickHouse/issues/\2
)'
,
pr
[
"entry"
])
print
(
f
'*
{
pr
[
"entry"
]
}
[#
{
pr
[
"number"
]
}
](
{
pr
[
"html_url"
]
}
) ([
{
user_name
}
](
{
user
[
"html_url"
]
}
)).'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录