Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
185f09e5
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,发现更多精彩内容 >>
提交
185f09e5
编写于
8月 07, 2005
作者:
K
Kay Sievers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v049
上级
ff7669a5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
18 deletion
+26
-18
gitweb.pl
gitweb.pl
+26
-18
未找到文件。
gitweb.pl
浏览文件 @
185f09e5
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
my
$cgi
=
new
CGI
;
my
$cgi
=
new
CGI
;
my
$version
=
"
04
8
";
my
$version
=
"
04
9
";
my
$projectroot
=
"
/
";
my
$projectroot
=
"
/
";
my
$defaultprojects
=
"
home/kay/public_html
";
my
$defaultprojects
=
"
home/kay/public_html
";
my
$gitbin
=
"
/home/kay/bin/git
";
my
$gitbin
=
"
/home/kay/bin/git
";
...
@@ -130,14 +130,14 @@ sub git_commit {
...
@@ -130,14 +130,14 @@ sub git_commit {
push
@parents
,
$
1
;
push
@parents
,
$
1
;
}
elsif
(
$line
=~
m/^author (.*) ([0-9]+) (.*)$/
)
{
}
elsif
(
$line
=~
m/^author (.*) ([0-9]+) (.*)$/
)
{
$co
{'
author
'}
=
$
1
;
$co
{'
author
'}
=
$
1
;
$co
{'
author_
time_
epoch
'}
=
$
2
;
$co
{'
author_epoch
'}
=
$
2
;
$co
{'
author_t
imezone
'}
=
$
3
;
$co
{'
author_t
z
'}
=
$
3
;
$co
{'
author_name
'}
=
$co
{'
author
'};
$co
{'
author_name
'}
=
$co
{'
author
'};
$co
{'
author_name
'}
=~
s/ <.*//
;
$co
{'
author_name
'}
=~
s/ <.*//
;
}
elsif
(
$line
=~
m/^committer (.*) ([0-9]+) (.*)$/
)
{
}
elsif
(
$line
=~
m/^committer (.*) ([0-9]+) (.*)$/
)
{
$co
{'
committer
'}
=
$
1
;
$co
{'
committer
'}
=
$
1
;
$co
{'
committer_
time_
epoch
'}
=
$
2
;
$co
{'
committer_epoch
'}
=
$
2
;
$co
{'
committer_t
imezone
'}
=
$
3
;
$co
{'
committer_t
z
'}
=
$
3
;
$co
{'
committer_name
'}
=
$co
{'
committer
'};
$co
{'
committer_name
'}
=
$co
{'
committer
'};
$co
{'
committer_name
'}
=~
s/ <.*//
;
$co
{'
committer_name
'}
=~
s/ <.*//
;
}
}
...
@@ -254,7 +254,9 @@ sub date_str {
...
@@ -254,7 +254,9 @@ sub date_str {
$tz
=~
m/((-|\+)[0-9][0-9])([0-9][0-9])/
;
$tz
=~
m/((-|\+)[0-9][0-9])([0-9][0-9])/
;
my
$local
=
$epoch
+
((
$
1
+
(
$
2
/
60
))
*
3600
);
my
$local
=
$epoch
+
((
$
1
+
(
$
2
/
60
))
*
3600
);
(
$sec
,
$min
,
$hour
,
$mday
,
$mon
,
$year
,
$wday
,
$yday
)
=
gmtime
(
$local
);
(
$sec
,
$min
,
$hour
,
$mday
,
$mon
,
$year
,
$wday
,
$yday
)
=
gmtime
(
$local
);
$date
{'
rfc2822_local
'}
=
sprintf
"
%s, %d %s %4d %02d:%02d:%02d %s
",
$days
[
$wday
],
$mday
,
$months
[
$mon
],
1900
+
$year
,
$hour
,
$min
,
$sec
,
$tz
;
$date
{'
hour_local
'}
=
$hour
;
$date
{'
minute_local
'}
=
$min
;
$date
{'
tz_local
'}
=
$tz
;
return
%date
;
return
%date
;
}
}
...
@@ -367,8 +369,8 @@ sub date_str {
...
@@ -367,8 +369,8 @@ sub date_str {
for
(
my
$i
=
0
;
$i
<=
$#revtree
;
$i
++
)
{
for
(
my
$i
=
0
;
$i
<=
$#revtree
;
$i
++
)
{
my
$commit
=
$revtree
[
$i
];
my
$commit
=
$revtree
[
$i
];
my
%co
=
git_commit
(
$commit
);
my
%co
=
git_commit
(
$commit
);
my
%ad
=
date_str
(
$co
{'
author_
time_
epoch
'});
my
%ad
=
date_str
(
$co
{'
author_epoch
'});
my
$age
=
time
-
$co
{'
committer_
time_
epoch
'};
my
$age
=
time
-
$co
{'
committer_epoch
'};
my
$age_string
;
my
$age_string
;
if
(
$age
>
60
*
60
*
24
*
365
*
2
)
{
if
(
$age
>
60
*
60
*
24
*
365
*
2
)
{
$age_string
=
int
$age
/60/
60
/24/
365
;
$age_string
=
int
$age
/60/
60
/24/
365
;
...
@@ -438,8 +440,8 @@ sub date_str {
...
@@ -438,8 +440,8 @@ sub date_str {
}
}
}
elsif
(
$action
eq
"
commit
")
{
}
elsif
(
$action
eq
"
commit
")
{
my
%co
=
git_commit
(
$hash
);
my
%co
=
git_commit
(
$hash
);
my
%ad
=
date_str
(
$co
{'
author_
time_epoch
'},
$co
{'
author_time_zone
'});
my
%ad
=
date_str
(
$co
{'
author_
epoch
'},
$co
{'
author_tz
'});
my
%cd
=
date_str
(
$co
{'
committer_
time_epoch
'},
$co
{'
committer_time_zone
'});
my
%cd
=
date_str
(
$co
{'
committer_
epoch
'},
$co
{'
committer_tz
'});
open
my
$fd
,
"
-|
",
"
$gitbin
/diff-tree -r
"
.
$co
{'
parent
'}
.
"
$hash
";
open
my
$fd
,
"
-|
",
"
$gitbin
/diff-tree -r
"
.
$co
{'
parent
'}
.
"
$hash
";
my
(
@difftree
)
=
map
{
chomp
;
$_
}
<
$fd
>
;
my
(
@difftree
)
=
map
{
chomp
;
$_
}
<
$fd
>
;
close
$fd
;
close
$fd
;
...
@@ -450,16 +452,22 @@ sub date_str {
...
@@ -450,16 +452,22 @@ sub date_str {
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=commitdiff;h=
$hash
"},
"
diff
")
.
"
\n
"
.
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=commitdiff;h=
$hash
"},
"
diff
")
.
"
\n
"
.
"
<br/><br/></div>
\n
";
"
<br/><br/></div>
\n
";
print
"
<a class=
\"
log_title
\"
href=
\"
$my_uri
?p=
$project
;a=commitdiff;h=
$hash
\"
>
$co
{'title'}</a>
\n
";
print
"
<a class=
\"
log_title
\"
href=
\"
$my_uri
?p=
$project
;a=commitdiff;h=
$hash
\"
>
$co
{'title'}</a>
\n
";
print
"
<div class=
\"
log_head
\"
>
"
.
print
"
<div class=
\"
log_head
\"
>
\n
";
"
author
"
.
escapeHTML
(
$co
{'
author
'})
.
"
[
"
.
$ad
{'
rfc2822
'}
.
"
]<br/>
\n
";
print
"
author
"
.
escapeHTML
(
$co
{'
author
'})
.
"
<br/>
\n
";
if
(
$ad
{'
hour
'}
<
7
)
{
print
"
<span style=
\"
color: #990000;
\"
>
";
}
print
"
author-time
"
.
$ad
{'
rfc2822
'};
if
(
$ad
{'
hour
'}
<
7
)
{
print
"
</span>
";
}
if
(
$ad
{'
hour_local
'}
<
6
)
{
print
"
<span style=
\"
color: #cc0000;
\"
>
";
}
print
"
committer
"
.
escapeHTML
(
$co
{'
committer
'})
.
"
[
"
.
$cd
{'
rfc2822
'}
.
"
]<br/>
\n
"
.
printf
("
(%02d:%02d %s)
",
$ad
{'
hour_local
'},
$ad
{'
minute_local
'},
$ad
{'
tz_local
'});
"
commit
$hash
<br/>
\n
"
.
if
(
$ad
{'
hour_local
'}
<
6
)
{
print
"
</span>
";
}
"
tree
"
.
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=tree;h=
$co
{'tree'}
"},
$co
{'
tree
'})
.
"
<br/>
\n
";
print
"
<br/>
\n
";
print
"
committer
"
.
escapeHTML
(
$co
{'
committer
'})
.
"
<br/>
\n
";
print
"
commit-time
"
.
$ad
{'
rfc2822
'};
printf
("
(%02d:%02d %s)
",
$cd
{'
hour_local
'},
$cd
{'
minute_local
'},
$cd
{'
tz_local
'});
print
"
<br/>
\n
";
print
"
commit  
$hash
<br/>
\n
";
print
"
tree  
"
.
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=tree;h=
$co
{'tree'}
"},
$co
{'
tree
'})
.
"
<br/>
\n
";
my
$parents
=
$co
{'
parents
'};
my
$parents
=
$co
{'
parents
'};
foreach
my
$par
(
@$parents
)
{
foreach
my
$par
(
@$parents
)
{
print
"
parent  
;
"
.
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=commit;h=
$par
"},
$par
)
.
"
<br/>
\n
";
print
"
parent  
 
"
.
$cgi
->
a
({
-
href
=>
"
$my_uri
?p=
$project
;a=commit;h=
$par
"},
$par
)
.
"
<br/>
\n
";
}
}
print
"
</div>
\n
";
print
"
</div>
\n
";
print
"
<div class=
\"
page_body
\"
>
\n
";
print
"
<div class=
\"
page_body
\"
>
\n
";
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录