Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
cc928b23
提交
cc928b23
authored
4月 28, 2014
作者:
Travis Cross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add helper for running git bisect
上级
6e418985
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
107 行增加
和
0 行删除
+107
-0
bisect
scripts/bisect
+107
-0
没有找到文件。
scripts/bisect
0 → 100755
浏览文件 @
cc928b23
#!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### Author: Travis Cross <tc@traviscross.com>
log1
()
{
printf
'%s'
"
$1
"
>
&2
;
}
log
()
{
printf
'%s\n'
"
$1
"
>
&2
;
}
err
()
{
log
"
$1
"
;
exit
1
;
}
usage
()
{
log
"usage:
$0
"
}
while
getopts
"h"
o
;
do
case
"
$o
"
in
h
)
usage
;
exit
0
;
;;
esac
done
shift
$((
$OPTIND
-
1
))
runscript
=
$(
mktemp
/tmp/bisectrunXXXXXXXX
)
touch
$runscript
chmod
+x
$runscript
cat
>
$runscript
<<
'
EOF
'
#!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### Author: Travis Cross <tc@traviscross.com>
build_fs () (
set -e
unset CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS CCACHE_DIR V VERBOSE
export V=1 VERBOSE=1
git clean -fdx
git reset --hard HEAD
{ git describe HEAD \
&& ./bootstrap.sh -j \
&& ./configure -C --enable-fhs \
&& make; } 2>&1 | tee build.log
)
good () { exit 0; }
bad () { exit 1; }
skip () { exit 125; }
printf "Building FS...\n"
if ! build_fs; then
printf "FS didn't build correctly, skipping this revision...\n"
skip
fi
printf "OK, now 'make install' if needed and test for the issue...\n"
printf "When done, type 'exit'\n"
bash
tested=""
while test -z "
$tested
"; do
printf "Were you able to test the issue at this revision? [y/n]: "
read tested
done
if test "
$tested
" != "y"; then
printf "OK, we're skipping this revision then...\n"
skip
fi
reproduced=""
while test -z "
$reproduced
"; do
printf "Did the issue reproduce at this revision? [y/n]: "
read reproduced
done
if test "
$reproduced
" = "y"; then
printf "OK, marking this as a bad revision...\n"
bad
else
printf "OK, marking this as a good revision...\n"
good
fi
EOF
run_bisect
()
{
goods
=
""
bad
=
""
paths
=
""
while
test
-z
"
$bad
"
;
do
printf
"Enter git hash of earliest known bad revision: "
read
bad_
[
-z
"
$bad_
"
]
||
bad
=
"
$bad_
"
done
good_
=
""
while
test
-z
"
$goods
"
||
!
test
-z
"
$good_
"
;
do
printf
"Enter git hash of latest known good revisions ('.' to end): "
read
good_
[
"
$good_
"
=
"."
]
&&
good_
=
""
[
-z
"
$good_
"
]
||
goods
=
"
$good_
"
done
path_
=
"_"
while
!
test
-z
"
$path_
"
;
do
printf
"(optional) Enter source path related to issue ('.' to end): "
read
path_
[
"
$path_
"
=
"."
]
&&
path_
=
""
[
-z
"
$path_
"
]
||
paths
=
"
$path_
"
done
printf
"Starting git bisect...
\n
"
git bisect start
$bad
$goods
--
$paths
git bisect run
$runscript
rm
-f
$runscript
git bisect reset
}
bisectlog
=
/tmp/
$(
date
-u
+%Y%m%dT%H%M%SZ
)
-bisect_log
.txt
run_bisect |
tee
$bisectlog
printf
"
\n\n
Now please upload
$bisectlog
to JIRA.
\n
"
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论