Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
3f714537
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,发现更多精彩内容 >>
提交
3f714537
编写于
8月 07, 2005
作者:
K
Kay Sievers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v021
上级
703ac710
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
33 addition
and
70 deletion
+33
-70
gitweb.pl
gitweb.pl
+33
-70
未找到文件。
gitweb.pl
浏览文件 @
3f714537
...
...
@@ -109,7 +109,7 @@ sub git_header_html {
div.head2 a:visited { color:#0000cc; }
div.head2 a:hover { color:#880000; }
div.head2 a:active { color:#880000; }
div.
shortlog
{ padding:8px; background-color: #D9D8D1; font-weight:bold; }
div.
title
{ padding:8px; background-color: #D9D8D1; font-weight:bold; }
table { padding:0px; margin:0px; width:100%; }
tr { vertical-align:top; }
td { padding:8px; margin:0px; font-family: sans-serif; font-size: 12px; }
...
...
@@ -175,26 +175,16 @@ sub git_commit {
$co
{'
committer_time
'}
=
$
2
;
$co
{'
committer_timezone
'}
=
$
3
;
}
elsif
(
$line
=~
m/^author (.*>) ([0-9]+) (.*)$/
)
{
$co
{'
$
author
'}
=
$
1
;
$co
{'
$
author_time
'}
=
$
2
;
$co
{'
$
author_timezone
'}
=
$
3
;
$co
{'
author
'}
=
$
1
;
$co
{'
author_time
'}
=
$
2
;
$co
{'
author_timezone
'}
=
$
3
;
}
}
my
$shortlog
=
<
$fd
>
;
chomp
(
$shortlog
);
$co
{'
shortlog
'}
=
escapeHTML
(
$shortlog
);
my
$comment
=
$shortlog
.
"
<br/>
";
while
(
my
$line
=
<
$fd
>
)
{
chomp
(
$line
);
if
(
$line
=~
m/signed-off-by:/i
)
{
$comment
.=
'
<div class="signed_off">
'
.
escapeHTML
(
$line
)
.
"
<br/></div>
\n
";
}
else
{
$comment
.=
escapeHTML
(
$line
)
.
"
<br/>
\n
";
}
}
$co
{'
comment
'}
=
$comment
;
$co
{'
parents
'}
=
\
@parents
;
my
(
@comment
)
=
map
{
chomp
;
$_
}
<
$fd
>
;
$co
{'
comment
'}
=
\
@comment
;
$co
{'
title
'}
=
$comment
[
0
];
close
$fd
;
return
%co
;
}
...
...
@@ -354,45 +344,9 @@ sub git_diff {
my
$time
=
$
1
;
my
$commit
=
$
2
;
my
$parent
=
$
3
;
my
@parents
;
my
(
$author
,
$author_time
,
$author_timezone
);
my
(
$committer
,
$committer_time
,
$committer_timezone
);
my
$tree
;
my
$comment
;
my
$shortlog
;
open
my
$fd
,
"
-|
",
"
$gitbin
/cat-file
",
"
commit
",
$commit
;
while
(
my
$line
=
<
$fd
>
)
{
chomp
(
$line
);
last
if
$line
eq
"";
if
(
$line
=~
m/^tree (.*)$/
)
{
$tree
=
$
1
;
}
elsif
(
$line
=~
m/^parent (.*)$/
)
{
push
@parents
,
$
1
;
}
elsif
(
$line
=~
m/^committer (.*>) ([0-9]+) (.*)$/
)
{
$committer
=
$
1
;
$committer_time
=
$
2
;
$committer_timezone
=
$
3
;
}
elsif
(
$line
=~
m/^author (.*>) ([0-9]+) (.*)$/
)
{
$author
=
$
1
;
$author_time
=
$
2
;
$author_timezone
=
$
3
;
}
}
$shortlog
=
<
$fd
>
;
chomp
(
$shortlog
);
$shortlog
=
escapeHTML
(
$shortlog
);
$comment
=
$shortlog
.
"
<br/>
";
while
(
my
$line
=
<
$fd
>
)
{
chomp
(
$line
);
if
(
$line
=~
m/signed-off-by:/i
)
{
$comment
.=
'
<div class="signed_off">
'
.
escapeHTML
(
$line
)
.
"
<br/></div>
\n
";
}
else
{
$comment
.=
escapeHTML
(
$line
)
.
"
<br/>
\n
";
}
}
close
$fd
;
my
$age
=
time
-
$committer_time
;
my
%co
=
git_commit
(
$commit
);
my
$age
=
time
-
$co
{'
committer_time
'};
my
$age_string
;
if
(
$age
>
60
*
60
*
24
*
365
*
2
)
{
$age_string
=
int
$age
/60/
60
/24/
365
;
...
...
@@ -424,20 +378,21 @@ sub git_diff {
}
print
"
<tr>
\n
";
print
"
<td class=
\"
head1
\"
>
"
.
$age_string
.
"
</td>
\n
";
print
"
<td class=
\"
head1
\"
>
"
.
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commit/
$commit
"},
$
shortlog
)
.
"
</td>
";
print
"
<td class=
\"
head1
\"
>
"
.
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commit/
$commit
"},
$
co
{'
title
'}
)
.
"
</td>
";
print
"
</tr>
\n
";
print
"
<tr>
\n
";
print
"
<td class=
\"
head3
\"
>
";
print
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commitdiff/
$commit
"},
"
view diff
")
.
"
<br/>
\n
";
print
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commit/
$commit
"},
"
view commit
")
.
"
<br/>
\n
";
print
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/tree/
$
tree
"},
"
view tree
")
.
"
<br/>
\n
";
print
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/tree/
$
co
{'tree'}
"},
"
view tree
")
.
"
<br/>
\n
";
print
"
</td>
\n
";
print
"
<td class=
\"
head2
\"
>
\n
";
print
"
author
"
.
escapeHTML
(
$
author
)
.
"
[
"
.
gmtime
(
$author_time
)
.
"
"
.
$author_timezone
.
"
]<br/>
\n
";
print
"
committer
"
.
escapeHTML
(
$co
mmitter
)
.
"
[
"
.
gmtime
(
$committer_time
)
.
"
"
.
$committer_timezone
.
"
]<br/>
\n
";
print
"
author
"
.
escapeHTML
(
$
co
{'
author
'})
.
"
[
"
.
gmtime
(
$co
{'
author_time
'})
.
"
"
.
$co
{'
author_timezone
'}
.
"
]<br/>
\n
";
print
"
committer
"
.
escapeHTML
(
$co
{'
committer
'})
.
"
[
"
.
gmtime
(
$co
{'
committer_time
'})
.
"
"
.
$co
{'
committer_timezone
'}
.
"
]<br/>
\n
";
print
"
commit
$commit
<br/>
\n
";
print
"
tree
$tree
<br/>
\n
";
foreach
my
$par
(
@parents
)
{
print
"
tree
$co
{'tree'}<br/>
\n
";
my
$parents
=
$co
{'
parents
'};
foreach
my
$par
(
@$parents
)
{
print
"
parent
$par
<br/>
\n
";
}
print
"
</td>
";
...
...
@@ -445,12 +400,20 @@ sub git_diff {
print
"
<tr>
\n
";
print
"
<td></td>
\n
";
print
"
<td>
\n
";
print
"
$comment
<br/><br/>
\n
";
my
$comment
=
$co
{'
comment
'};
foreach
my
$line
(
@$comment
)
{
if
(
$line
=~
m/signed-off-by:/i
)
{
print
'
<div class="signed_off">
'
.
escapeHTML
(
$line
)
.
"
<br/></div>
\n
";
}
else
{
print
escapeHTML
(
$line
)
.
"
<br/>
\n
";
}
}
print
"
<br/><br/>
\n
";
print
"
</td>
";
print
"
</tr>
\n
";
}
elsif
(
$action
eq
"
rss
")
{
last
if
(
$i
>=
12
);
print
"
<item>
\n\t
<title>
$age_string
:
$shortlog
</title>
\n
";
print
"
<item>
\n\t
<title>
$age_string
:
"
.
escapeHTML
(
$co
{'
title
'})
.
"
</title>
\n
";
print
"
\t
<link>
"
.
$cgi
->
url
()
.
"
/
$project
/commit/
$commit
</link>
\n
";
print
"
</item>
\n
";
}
...
...
@@ -471,8 +434,8 @@ sub git_diff {
$parent
=
$
1
;
}
}
my
$
shortlog
=
<
$fd
>
;
$
shortlog
=
escapeHTML
(
$shortlog
);
my
$
title
=
<
$fd
>
;
$
title
=
escapeHTML
(
$title
);
close
$fd
;
open
$fd
,
"
-|
",
"
$gitbin
/diff-tree
",
"
-r
",
$parent
,
$hash
;
...
...
@@ -482,7 +445,7 @@ sub git_diff {
git_header_html
();
print
"
<div class=
\"
head2
\"
>
\n
";
print
"
view
"
.
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commitdiff/
$hash
"},
"
diff
")
.
"
</div><br/><br/>
\n
";
print
"
<div class=
\"
shortlog
\"
>
$shortlog
<br/></div>
\n
";
print
"
<div class=
\"
title
\"
>
$title
<br/></div>
\n
";
print
"
<pre>
\n
";
foreach
my
$line
(
@difftree
)
{
# '*100644->100644 blob 9f91a116d91926df3ba936a80f020a6ab1084d2b->bb90a0c3a91eb52020d0db0e8b4f94d30e02d596 net/ipv4/route.c'
...
...
@@ -527,8 +490,8 @@ sub git_diff {
$parent
=
$
1
;
}
}
my
$
shortlog
=
<
$fd
>
;
$
shortlog
=
escapeHTML
(
$shortlog
);
my
$
title
=
<
$fd
>
;
$
title
=
escapeHTML
(
$title
);
close
$fd
;
open
$fd
,
"
-|
",
"
$gitbin
/diff-tree
",
"
-r
",
$parent
,
$hash
;
...
...
@@ -538,7 +501,7 @@ sub git_diff {
git_header_html
();
print
"
<div class=
\"
head2
\"
>
\n
";
print
"
view
"
.
$cgi
->
a
({
-
href
=>
"
$myself
/
$project
/commit/
$hash
"},
"
commit
")
.
"
</div><br/><br/>
\n
";
print
"
<div class=
\"
shortlog
\"
>
$shortlog
<br/></div>
\n
";
print
"
<div class=
\"
title
\"
>
$title
<br/></div>
\n
";
print
"
<pre>
\n
";
foreach
my
$line
(
@difftree
)
{
# '*100644->100644 blob 8e5f9bbdf4de94a1bc4b4da8cb06677ce0a57716->8da3a306d0c0c070d87048d14a033df02f40a154 Makefile'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录