Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
810c91fe
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
810c91fe
编写于
11月 02, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor search by commits message
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
a0d0a017
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
41 deletion
+11
-41
CHANGELOG
CHANGELOG
+1
-3
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+2
-0
app/models/repository.rb
app/models/repository.rb
+3
-3
app/views/search/_category.html.haml
app/views/search/_category.html.haml
+1
-1
app/views/search/results/_commits.html.haml
app/views/search/results/_commits.html.haml
+1
-31
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+1
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+2
-2
未找到文件。
CHANGELOG
浏览文件 @
810c91fe
...
...
@@ -14,6 +14,7 @@ v 8.2.0 (unreleased)
- Fix: 500 error returned if destroy request without HTTP referer (Kazuki Shimizu)
- Remove deprecated CI events from project settings page
- Use issue editor as cross reference comment author when issue is edited with a new mention.
- Include commit logs in project search
v 8.1.1
- Fix cloning Wiki repositories via HTTP (Stan Hu)
...
...
@@ -29,9 +30,6 @@ v 8.1.0
- Ensure MySQL CI limits DB migrations occur after the fields have been created (Stan Hu)
- Fix duplicate repositories in GitHub import page (Stan Hu)
- Redirect to a default path if HTTP_REFERER is not set (Stan Hu)
- Include commit logs in project search
v 8.1.0 (unreleased)
- Send an email to admin email when a user is reported for spam (Jonathan Rochkind)
- Show notifications button when user is member of group rather than project (Grzegorz Bizon)
- Fix bug preventing mentioned issued from being closed when MR is merged using fast-forward merge.
...
...
app/assets/stylesheets/pages/commits.scss
浏览文件 @
810c91fe
...
...
@@ -33,6 +33,8 @@
}
li
.commit
{
list-style
:
none
;
.commit-row-title
{
font-size
:
$list-font-size
;
line-height
:
20px
;
...
...
app/models/repository.rb
浏览文件 @
810c91fe
...
...
@@ -87,12 +87,12 @@ class Repository
commits
end
def
find_commits_
with_matching_log
(
query
)
def
find_commits_
by_message
(
query
)
# Limited to 1000 commits for now, could be parameterized?
args
=
%W(git log --pretty=%H --max-count 1000 --grep=
#{
query
}
)
git_log_results
=
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
).
first
.
lines
.
map
{
|
l
|
l
.
chomp
}
commits
=
git_log_results
.
map
{
|
c
|
commit
(
c
)
}
git_log_results
=
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
).
first
.
lines
.
map
(
&
:chomp
)
commits
=
git_log_results
.
map
{
|
c
|
commit
(
c
)
}
commits
end
...
...
app/views/search/_category.html.haml
浏览文件 @
810c91fe
...
...
@@ -46,7 +46,7 @@
=
link_to
search_filter_path
(
scope:
'commits'
)
do
=
icon
(
'history fw'
)
%span
Commit
Log
s
Commits
%span
.badge
=
@search_results
.
commits_count
...
...
app/views/search/results/_commits.html.haml
浏览文件 @
810c91fe
.search-result-row
.commits-row-title
%strong
.str-truncated
=
link_to
commits
.
title
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commits
.
id
),
class:
"commit_short_id"
.pull-right
=
link_to
commits
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
commits
.
id
),
class:
"commit_short_id"
.notes_count
-
if
@note_counts
-
note_count
=
@note_counts
.
fetch
(
commits
.
id
,
0
)
-
else
-
notes
=
commits
.
notes
-
note_count
=
notes
.
user
.
count
-
if
note_count
>
0
%span
.light
%i
.fa.fa-comments
=
note_count
-
if
commits
.
description?
.commits-row-description
%pre
=
preserve
(
gfm
(
escape_once
(
commits
.
description
)))
.commits-row-info
=
commit_author_link
(
commits
,
avatar:
true
,
size:
24
)
authored
.committed_ago
#{
time_ago_with_tooltip
(
commits
.
committed_date
)
}
=
link_to_browse_code
(
@project
,
commits
)
%br
=
render
'projects/commits/commit'
,
project:
@project
,
commit:
commits
lib/gitlab/project_search_results.rb
浏览文件 @
810c91fe
...
...
@@ -77,7 +77,7 @@ module Gitlab
end
def
commits
project
.
repository
.
find_commits_
with_matching_log
(
query
)
project
.
repository
.
find_commits_
by_message
(
query
)
end
def
limit_project_ids
...
...
spec/models/repository_spec.rb
浏览文件 @
810c91fe
...
...
@@ -26,8 +26,8 @@ describe Repository do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
end
describe
:find_commits_
with_matching_log
do
subject
{
repository
.
find_commits_
with_matching_log
(
'submodule'
).
map
{
|
k
|
k
.
id
}
}
describe
:find_commits_
by_message
do
subject
{
repository
.
find_commits_
by_message
(
'submodule'
).
map
{
|
k
|
k
.
id
}
}
it
{
is_expected
.
to
include
(
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
)
}
it
{
is_expected
.
to
include
(
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录