Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
07cdbb35
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,发现更多精彩内容 >>
提交
07cdbb35
编写于
9月 27, 2005
作者:
H
H. Peter Anvin
浏览文件
操作
浏览文件
下载
差异文件
Merge with
git+ssh://master.kernel.org/pub/scm/git/git.git
上级
47888f0f
3cc35e29
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
89 addition
and
39 deletion
+89
-39
git-clone.sh
git-clone.sh
+15
-6
git-commit.sh
git-commit.sh
+3
-0
git-core.spec.in
git-core.spec.in
+1
-1
git-fetch.sh
git-fetch.sh
+1
-1
git-merge.sh
git-merge.sh
+56
-18
git-revert.sh
git-revert.sh
+4
-1
git-sh-setup.sh
git-sh-setup.sh
+0
-11
gitk
gitk
+9
-1
未找到文件。
git-clone.sh
浏览文件 @
07cdbb35
...
...
@@ -9,7 +9,7 @@
unset
CDPATH
usage
()
{
echo
>
&2
"* git clone [-l [-s]] [-q] [-u <upload-pack>] <repo> <dir>"
echo
>
&2
"* git clone [-l [-s]] [-q] [-u <upload-pack>]
[-n]
<repo> <dir>"
exit
1
}
...
...
@@ -61,10 +61,12 @@ Perhaps git-update-server-info needs to be run there?"
quiet
=
use_local
=
no
local_shared
=
no
no_checkout
=
upload_pack
=
while
case
"
$#,$1
"
in
0,
*
)
break
;;
*
,-n
)
no_checkout
=
yes
;;
*
,-l|
*
,--l|
*
,--lo|
*
,--loc|
*
,--loca|
*
,--local
)
use_local
=
yes
;;
*
,-s|
*
,--s|
*
,--sh|
*
,--sha|
*
,--shar|
*
,--share|
*
,--shared
)
local_shared
=
yes
;;
...
...
@@ -186,9 +188,16 @@ yes,yes)
;;
esac
# Update origin.
mkdir
-p
"
$D
/.git/remotes/"
&&
rm
-f
"
$D
/.git/remotes/origin"
&&
echo
>
"
$D
/.git/remotes/origin"
\
"URL:
$repo
cd
$D
||
exit
if
test
-f
".git/HEAD"
then
mkdir
-p
.git/remotes
||
exit
echo
>
.git/remotes/origin
\
"URL:
$repo
Pull: master:origin"
case
"
$no_checkout
"
in
''
)
git checkout
esac
fi
git-commit.sh
浏览文件 @
07cdbb35
...
...
@@ -141,6 +141,9 @@ t)
esac
if
[
-f
"
$GIT_DIR
/MERGE_HEAD"
]
;
then
test
-f
"
$GIT_DIR
/MERGE_MSG"
&&
cat
"
$GIT_DIR
/MERGE_MSG"
echo
"#"
echo
"# It looks like your may be committing a MERGE."
echo
"# If this is not correct, please remove the file"
...
...
git-core.spec.in
浏览文件 @
07cdbb35
...
...
@@ -9,7 +9,7 @@ URL: http://kernel.org/pub/software/scm/git/
Source: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
BuildRequires: zlib-devel, openssl-devel, curl-devel %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: rsync, rcs, curl, less, openssh-clients, python >= 2.3, tk
Requires: rsync, rcs, curl, less, openssh-clients, python >= 2.3, tk
>= 8.4
%description
This is a stupid (but extremely fast) directory content manager. It
...
...
git-fetch.sh
浏览文件 @
07cdbb35
...
...
@@ -178,7 +178,7 @@ do
head
=
$(
curl
-nsf
$curl_extra_args
"
$remote
/
$remote_name
"
)
&&
expr
"
$head
"
:
"
$_x40
\$
"
>
/dev/null
||
die
"Failed to fetch
$remote_name
from
$remote
"
echo
Fetching
"
$remote_name
from
$remote
"
using http
echo
>
&2
Fetching
"
$remote_name
from
$remote
"
using http
git-http-fetch
-v
-a
"
$head
"
"
$remote
/"
||
exit
;;
rsync://
*
)
...
...
git-merge.sh
浏览文件 @
07cdbb35
...
...
@@ -18,8 +18,22 @@ all_strategies='recursive octopus resolve stupid'
default_strategies
=
'resolve octopus'
use_strategies
=
dropheads
()
{
rm
-f
--
"
$GIT_DIR
/MERGE_HEAD"
||
exit
1
dropsave
()
{
rm
-f
--
"
$GIT_DIR
/MERGE_HEAD"
"
$GIT_DIR
/MERGE_MSG"
\
"
$GIT_DIR
/MERGE_SAVE"
||
exit
1
}
savestate
()
{
git diff
-r
-z
--name-only
$head
| cpio
-0
-o
>
"
$GIR_DIR
/MERGE_SAVE"
}
restorestate
()
{
if
test
-f
"
$GIT_DIR
/MERGE_SAVE"
then
git reset
--hard
$head
cpio
-iuv
<
"
$GIT_DIR
/MERGE_SAVE"
git-update-index
--refresh
>
/dev/null
fi
}
summary
()
{
...
...
@@ -93,7 +107,7 @@ case "$#,$common" in
# If head can reach all the merge then we are up to date.
# but first the most common case of merging one remote
echo
"Already up-to-date. Yeeah!"
drop
heads
drop
save
exit
0
;;
1,
"
$head
"
)
...
...
@@ -103,7 +117,7 @@ case "$#,$common" in
git-read-tree
-u
-m
$head
"
$1
"
||
exit
1
git-rev-parse
--verify
"
$1
^0"
>
"
$GIT_DIR
/HEAD"
summary
"
$1
"
drop
heads
drop
save
exit
0
;;
1,
*
)
...
...
@@ -125,30 +139,52 @@ case "$#,$common" in
if
test
"
$up_to_date
"
=
t
then
echo
"Already up-to-date. Yeeah!"
drop
heads
drop
save
exit
0
fi
;;
esac
# At this point we need a real merge. Require that the tree matches
# exactly our head.
# At this point, we need a real merge. No matter what strategy
# we use, it would operate on the index, possibly affecting the
# working tree, and when resolved cleanly, have the desired tree
# in the index -- this means that the index must be in sync with
# the $head commit.
files
=
$(
git-diff-index
--cached
--name-only
$head
)
||
exit
if
[
"
$files
"
]
;
then
echo
>
&2
"Dirty index: cannot merge (dirty:
$files
)"
exit
1
fi
git-update-index
--refresh
&&
test
''
=
"
`
git-diff-index
--cached
--name-only
$head
`
"
||
{
die
"Need real merge but the working tree has local changes."
}
case
"
$use_strategies
"
in
?
*
' '
?
*
)
# Stash away the local changes so that we can try more than one.
savestate
single_strategy
=
no
;;
*
)
rm
-f
"
$GIT_DIR
/MERGE_SAVE"
single_strategy
=
yes
;;
esac
result_tree
=
best_cnt
=
-1
best_strategy
=
wt_strategy
=
for
strategy
in
$use_strategies
do
test
"
$wt_strategy
"
=
''
||
{
echo
"Rewinding the tree to pristine..."
git reset
--hard
$head
restorestate
}
echo
"Trying merge strategy
$strategy
..."
case
"
$single_strategy
"
in
no
)
echo
"Trying merge strategy
$strategy
..."
;;
esac
# Remember which strategy left the state in the working tree
wt_strategy
=
$strategy
git-merge-
$strategy
$common
--
$head_arg
"
$@
"
||
{
git-merge-
$strategy
$common
--
"
$head_arg
"
"
$@
"
||
{
# The backend exits with 1 when conflicts are left to be resolved,
# with 2 when it does not handle the given merge at all.
...
...
@@ -186,14 +222,14 @@ then
echo
"Committed merge
$result_commit
, made by
$wt_strategy
."
echo
$result_commit
>
"
$GIT_DIR
/HEAD"
summary
$result_commit
drop
heads
drop
save
exit
0
fi
# Pick the result from the best strategy and have the user fix it up.
case
"
$best_strategy
"
in
''
)
git reset
--hard
$head
restorestate
die
"No merge strategy handled the merge."
;;
"
$wt_strategy
"
)
...
...
@@ -201,13 +237,15 @@ case "$best_strategy" in
;;
*
)
echo
"Rewinding the tree to pristine..."
git reset
--hard
$head
restorestate
echo
"Using the
$best_strategy
to prepare resolving by hand."
git-merge-
$best_strategy
$common
--
$head_arg
"
$@
"
git-merge-
$best_strategy
$common
--
"
$head_arg
"
"
$@
"
;;
esac
for
remote
do
echo
$remote
done
>
"
$GIT_DIR
/MERGE_HEAD"
echo
$merge_msg
>
"
$GIT_DIR
/MERGE_MSG"
die
"Automatic merge failed; fix up by hand"
git-revert.sh
浏览文件 @
07cdbb35
...
...
@@ -56,9 +56,12 @@ t)
die
"Your index file is unmerged."
;;
*
)
check_clean_tree
||
die
"Cannot run
$me
from a dirty tree."
head
=
$(
git-rev-parse
--verify
HEAD
)
||
die
"You do not have a valid HEAD"
files
=
$(
git-diff-index
--cached
--name-only
$head
)
||
exit
if
[
"
$files
"
]
;
then
die
"Dirty index: cannot
$me
(dirty:
$files
)"
fi
;;
esac
...
...
git-sh-setup.sh
浏览文件 @
07cdbb35
...
...
@@ -17,17 +17,6 @@ die() {
exit
1
}
check_clean_tree
()
{
dirty1_
=
`
git-update-index
-q
--refresh
`
&&
{
dirty2_
=
`
git-diff-index
--name-only
--cached
HEAD
`
case
"
$dirty2_
"
in
''
)
:
;;
*
)
(
exit
1
)
;;
esac
}
||
{
echo
>
&2
"
$dirty1_
"
echo
"
$dirty2_
"
|
sed
>
&2
-e
's/^/modified: /'
(
exit
1
)
}
}
[
-h
"
$GIT_DIR
/HEAD"
]
&&
[
-d
"
$GIT_DIR
/refs"
]
&&
[
-d
"
$GIT_OBJECT_DIRECTORY
/00"
]
gitk
浏览文件 @
07cdbb35
#!/bin/sh
# Tcl ignores the next line -*- tcl -*-
\
exec wish
"
$0
"
--
"
$
{1+$@}
"
exec wish
"
$0
"
--
"
$
@
"
# Copyright
(
C
)
2005 Paul Mackerras. All rights reserved.
# This program is free software
;
it may be used, copied, modified
...
...
@@ -486,6 +486,8 @@ proc makewindow {} {
bindall <B2-Motion>
"allcanvs scan dragto 0 %y"
bind . <Key-Up>
"selnextline -1"
bind . <Key-Down>
"selnextline 1"
bind . <Key-Right>
"goforw"
bind . <Key-Left>
"goback"
bind . <Key-Prior>
"allcanvs yview scroll -1 pages"
bind . <Key-Next>
"allcanvs yview scroll 1 pages"
bindkey <Key-Delete>
"
$ctext
yview scroll -1 pages"
...
...
@@ -493,6 +495,12 @@ proc makewindow {} {
bindkey <Key-space>
"
$ctext
yview scroll 1 pages"
bindkey p
"selnextline -1"
bindkey n
"selnextline 1"
bindkey z
"goback"
bindkey x
"goforw"
bindkey i
"selnextline -1"
bindkey k
"selnextline 1"
bindkey j
"goback"
bindkey l
"goforw"
bindkey b
"
$ctext
yview scroll -1 pages"
bindkey d
"
$ctext
yview scroll 18 units"
bindkey u
"
$ctext
yview scroll -18 units"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录