Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
8fc66df2
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,发现更多精彩内容 >>
提交
8fc66df2
编写于
11月 20, 2005
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge
http://www.kernel.org/pub/scm/gitk/gitk
上级
f98d863d
f6e2869f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
50 addition
and
83 deletion
+50
-83
gitk
gitk
+50
-83
未找到文件。
gitk
浏览文件 @
8fc66df2
...
...
@@ -218,6 +218,8 @@ proc parsecommit {id contents listed olds} {
set i
[
string first
"
\n
"
$comment
]
if
{
$i
>= 0
}
{
set headline
[
string trim
[
string range $comment 0 $i
]]
}
else
{
set headline $comment
}
if
{
!$listed
}
{
# git-rev-list indents the comment by 4 spaces
;
...
...
@@ -226,6 +228,7 @@ proc parsecommit {id contents listed olds} {
foreach line
[
split $comment
"
\n
"
]
{
append newcomment
" "
append newcomment $line
append newcomment
"
\n
"
}
set comment $newcomment
}
...
...
@@ -238,77 +241,43 @@ proc parsecommit {id contents listed olds} {
proc readrefs
{}
{
global tagids idtags headids idheads tagcontents
set tags
[
glob -nocomplain -types f
[
gitdir
]
/refs/tags/*
]
foreach f $tags
{
catch
{
set fd
[
open $f r
]
set line
[
read $fd
]
if
{[
regexp
{
^
[
0-9a-f
]{
40
}}
$line id
]}
{
set direct
[
file tail $f
]
set tagids
(
$direct
)
$id
lappend idtags
(
$id
)
$direct
set tagblob
[
exec git-cat-file tag $id
]
set contents
[
split $tagblob
"
\n
"
]
set obj
{}
set type
{}
set tag
{}
foreach l $contents
{
if
{
$l
==
{}}
break
switch --
[
lindex $l 0
]
{
"object"
{
set obj
[
lindex $l 1
]}
"type"
{
set type
[
lindex $l 1
]}
"tag"
{
set tag
[
string range $l 4 end
]}
}
}
if
{
$obj
!=
{}
&& $type ==
"commit"
&& $tag !=
{}}
{
set tagids
(
$tag
)
$obj
lappend idtags
(
$obj
)
$tag
set tagcontents
(
$tag
)
$tagblob
}
}
close $fd
}
}
set heads
[
glob -nocomplain -types f
[
gitdir
]
/refs/heads/*
]
foreach f $heads
{
catch
{
set fd
[
open $f r
]
set line
[
read $fd 40
]
if
{[
regexp
{
^
[
0-9a-f
]{
40
}}
$line id
]}
{
set head
[
file tail $f
]
set headids
(
$head
)
$line
lappend idheads
(
$line
)
$head
}
close $fd
}
}
readotherrefs refs
{}
{
tags heads
}
}
proc readotherrefs
{
base dname excl
}
{
global otherrefids idotherrefs
set git
[
gitdir
]
set files
[
glob -nocomplain -types f
[
file join $git $base *
]]
foreach f $files
{
catch
{
set fd
[
open $f r
]
set line
[
read $fd 40
]
if
{[
regexp
{
^
[
0-9a-f
]{
40
}}
$line id
]}
{
set name
"
$dname
[
file tail $f
]
"
set otherrefids
(
$name
)
$id
lappend idotherrefs
(
$id
)
$name
set refd
[
open
[
list | git-ls-remote
[
gitdir
]]
r
]
while
{
0 <=
[
set n
[
gets $refd line
]]}
{
if
{
!
[
regexp
{
^
([
0-9a-f
]{
40
})
refs/
([
^^
]
*
)
$
}
$line
\
match id path
]}
{
continue
}
if
{
!
[
regexp
{
^
(
tags|heads
)
/
(
.*
)
$
}
$path match type name
]}
{
set type others
set name $path
}
if
{
$type
==
"tags"
}
{
set tagids
(
$name
)
$id
lappend idtags
(
$id
)
$name
set obj
{}
set type
{}
set tag
{}
catch
{
set commit
[
exec git-rev-parse
"
$id
^0"
]
if
{
"
$commit
"
!=
"
$id
"
}
{
set tagids
(
$name
)
$commit
lappend idtags
(
$commit
)
$name
}
}
catch
{
set tagcontents
(
$name
)
[
exec git-cat-file tag
"
$id
"
]
}
close $fd
}
elseif
{
$type ==
"heads"
}
{
set headids
(
$name
)
$id
lappend idheads
(
$id
)
$name
}
else
{
set otherrefids
(
$name
)
$id
lappend idotherrefs
(
$id
)
$name
}
}
set dirs
[
glob -nocomplain -types d
[
file join $git $base *
]]
foreach d $dirs
{
set dir
[
file tail $d
]
if
{[
lsearch -exact $excl $dir
]
>= 0
}
continue
readotherrefs
[
file join $base $dir
]
"
$dname$dir
/"
{}
}
close $refd
}
proc error_popup msg
{
...
...
@@ -1537,17 +1506,15 @@ proc drawrest {} {
global numcommits ncmupdate
global nextupdate startmsecs revlistorder
if
{
!$revlistorder
}
{
set level
[
decidenext
]
if
{
$level
>= 0
}
{
set phase drawgraph
while 1
{
lappend displayorder
[
lindex $todo $level
]
set hard
[
updatetodo $level $datemode
]
if
{
$hard
}
{
set level
[
decidenext
]
if
{
$level
< 0
}
break
}
set level
[
decidenext
]
if
{
$level
>= 0
}
{
set phase drawgraph
while 1
{
lappend displayorder
[
lindex $todo $level
]
set hard
[
updatetodo $level $datemode
]
if
{
$hard
}
{
set level
[
decidenext
]
if
{
$level
< 0
}
break
}
}
}
...
...
@@ -2821,8 +2788,7 @@ proc gettreediffs {ids} {
set treepending $ids
set treediff
{}
set id
[
lindex $ids 0
]
set p
[
lindex $ids 1
]
if
[
catch
{
set gdtf
[
open
"|git-diff-tree -r
$id
"
r
]}]
return
if
[
catch
{
set gdtf
[
open
"|git-diff-tree --no-commit-id -r
$id
"
r
]}]
return
fconfigure $gdtf -blocking 0
fileevent $gdtf readable
[
list gettreediffline $gdtf $ids
]
}
...
...
@@ -2856,9 +2822,8 @@ proc getblobdiffs {ids} {
global difffilestart nextupdate diffinhdr treediffs
set id
[
lindex $ids 0
]
set p
[
lindex $ids 1
]
set env
(
GIT_DIFF_OPTS
)
$diffopts
set cmd
[
list | git-diff-tree -r -p -C $id
]
set cmd
[
list | git-diff-tree -
-no-commit-id -
r -p -C $id
]
if
{[
catch
{
set bdf
[
open $cmd r
]}
err
]}
{
puts
"error getting diffs:
$err
"
return
...
...
@@ -3159,7 +3124,7 @@ proc linehover {} {
set t
[
$canv
create rectangle $x0 $y0 $x1 $y1
\
-fill
\#
ffff80 -outline black -width 1 -tags hover
]
$canv raise $t
set t
[
$canv
create text $x $y -anchor nw -text $text -tags hover
]
set t
[
$canv
create text $x $y -anchor nw -text $text -tags hover
-font $mainfont
]
$canv raise $t
}
...
...
@@ -3194,7 +3159,7 @@ proc clickisonarrow {id y} {
}
proc arrowjump
{
id dirn y
}
{
global mainline sidelines canv
global mainline sidelines canv
canv2 canv3
set yt
{}
if
{
$dirn
eq
"down"
}
{
...
...
@@ -3232,6 +3197,8 @@ proc arrowjump {id dirn y} {
set yfrac 0
}
$canv yview moveto $yfrac
$canv2 yview moveto $yfrac
$canv3 yview moveto $yfrac
}
proc lineclick
{
x y id isnew
}
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录