Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
20fa04ea
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
20fa04ea
编写于
3月 27, 2007
作者:
T
Theodore Ts'o
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mergetool: Replace use of "echo -n" with printf(1) to be more portable
Signed-off-by:
N
"Theodore Ts'o"
<
tytso@mit.edu
>
上级
e15b484f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
14 deletion
+12
-14
git-mergetool.sh
git-mergetool.sh
+12
-14
未找到文件。
git-mergetool.sh
浏览文件 @
20fa04ea
...
...
@@ -44,18 +44,16 @@ function describe_file () {
branch
=
"
$2
"
file
=
"
$3
"
echo
-n
" "
printf
" "
if
test
-z
"
$mode
"
;
then
echo
-n
"'
$path
' was deleted
"
printf
"'%s' was deleted"
"
$path
"
elif
is_symlink
"
$mode
"
;
then
echo
-n
"'
$path
' is a symlink containing '"
cat
"
$file
"
echo
-n
"'"
printf
"'%s' is a symlink containing '%s'"
"
$path
"
"
$file
"
else
if
base_present
;
then
echo
-n
"'
$path
' was created
"
printf
"'%s' was created"
"
$path
"
else
echo
-n
"'
$path
' was modified
"
printf
"'%s' was modified"
"
$path
"
fi
fi
echo
" in the
$branch
branch"
...
...
@@ -64,7 +62,7 @@ function describe_file () {
resolve_symlink_merge
()
{
while
/bin/true
;
do
echo
-n
"Use (r)emote or (l)ocal, or (a)bort? "
printf
"Use (r)emote or (l)ocal, or (a)bort? "
read
ans
case
"
$ans
"
in
[
lL]
*
)
...
...
@@ -88,7 +86,7 @@ resolve_symlink_merge () {
resolve_deleted_merge
()
{
while
/bin/true
;
do
echo
-n
"Use (m)odified or (d)eleted file, or (a)bort? "
printf
"Use (m)odified or (d)eleted file, or (a)bort? "
read
ans
case
"
$ans
"
in
[
mM]
*
)
...
...
@@ -157,7 +155,7 @@ merge_file () {
echo
"Normal merge conflict for
$path
:"
describe_file
"
$local_mode
"
"local"
"
$LOCAL
"
describe_file
"
$remote_mode
"
"remote"
"
$REMOTE
"
echo
-n
"Hit return to start merge resolution tool (
$merge_tool
):
"
printf
"Hit return to start merge resolution tool (%s): "
"
$merge_tool
"
read
ans
case
"
$merge_tool
"
in
...
...
@@ -193,7 +191,7 @@ merge_file () {
else
while
true
;
do
echo
"
$path
seems unchanged."
echo
-n
"Was the merge successful? [y/n] "
printf
"Was the merge successful? [y/n] "
read
answer < /dev/tty
case
"
$answer
"
in
y
*
|
Y
*
)
status
=
0
;
break
;;
...
...
@@ -225,7 +223,7 @@ merge_file () {
else
while
true
;
do
echo
"
$path
seems unchanged."
echo
-n
"Was the merge successful? [y/n] "
printf
"Was the merge successful? [y/n] "
read
answer < /dev/tty
case
"
$answer
"
in
y
*
|
Y
*
)
status
=
0
;
break
;;
...
...
@@ -346,12 +344,12 @@ if test $# -eq 0 ; then
echo
Merging the files:
$files
git ls-files
-u
|
sed
-e
's/^[^ ]* //'
|
sort
-u
|
while
read
i
do
echo
"
"
printf
"
\n
"
merge_file
"
$i
"
< /dev/tty
>
/dev/tty
done
else
while
test
$#
-gt
0
;
do
echo
"
"
printf
"
\n
"
merge_file
"
$1
"
shift
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录