Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
9d938fd7
Commit
9d938fd7
authored
Mar 17, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List new commits for newly pushed branch in activity view.
parent
dbd347bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
12 deletions
+18
-12
CHANGELOG
CHANGELOG
+1
-0
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+1
-1
app/models/event.rb
app/models/event.rb
+1
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+8
-2
lib/gitlab/push_data_builder.rb
lib/gitlab/push_data_builder.rb
+7
-8
No files found.
CHANGELOG
View file @
9d938fd7
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
v 7.10.0 (unreleased)
- Add a service to support external wikis (Hannes Rosenögger)
- Add a service to support external wikis (Hannes Rosenögger)
- List new commits for newly pushed branch in activity view.
v 7.9.0 (unreleased)
v 7.9.0 (unreleased)
- Add HipChat integration documentation (Stan Hu)
- Add HipChat integration documentation (Stan Hu)
...
...
app/helpers/events_helper.rb
View file @
9d938fd7
...
@@ -96,7 +96,7 @@ module EventsHelper
...
@@ -96,7 +96,7 @@ module EventsHelper
end
end
end
end
elsif
event
.
push?
elsif
event
.
push?
if
event
.
push_with_commits?
if
event
.
push_with_commits?
&&
event
.
md_ref?
if
event
.
commits_count
>
1
if
event
.
commits_count
>
1
namespace_project_compare_url
(
event
.
project
.
namespace
,
event
.
project
,
namespace_project_compare_url
(
event
.
project
.
namespace
,
event
.
project
,
from:
event
.
commit_from
,
to:
from:
event
.
commit_from
,
to:
...
...
app/models/event.rb
View file @
9d938fd7
...
@@ -247,7 +247,7 @@ class Event < ActiveRecord::Base
...
@@ -247,7 +247,7 @@ class Event < ActiveRecord::Base
end
end
def
push_with_commits?
def
push_with_commits?
md_ref?
&&
commits
.
an
y?
&&
commit_from
&&
commit_to
!
commits
.
empt
y?
&&
commit_from
&&
commit_to
end
end
def
last_push_to_non_root?
def
last_push_to_non_root?
...
...
app/views/events/event/_push.html.haml
View file @
9d938fd7
...
@@ -21,5 +21,11 @@
...
@@ -21,5 +21,11 @@
%li
.commits-stat
%li
.commits-stat
-
if
event
.
commits_count
>
2
-
if
event
.
commits_count
>
2
%span
... and
#{
event
.
commits_count
-
2
}
more commits.
%span
... and
#{
event
.
commits_count
-
2
}
more commits.
=
link_to
namespace_project_compare_path
(
event
.
project
.
namespace
,
event
.
project
,
from:
event
.
commit_from
,
to:
event
.
commit_to
)
do
-
if
event
.
md_ref?
%strong
Compare
→
#{
truncate_sha
(
event
.
commit_from
)
}
...
#{
truncate_sha
(
event
.
commit_to
)
}
-
from
=
event
.
commit_from
-
from_label
=
truncate_sha
(
from
)
-
else
-
from
=
event
.
project
.
default_branch
-
from_label
=
from
=
link_to
namespace_project_compare_path
(
event
.
project
.
namespace
,
event
.
project
,
from:
from
,
to:
event
.
commit_to
)
do
%strong
Compare
→
#{
from_label
}
...
#{
truncate_sha
(
event
.
commit_to
)
}
lib/gitlab/push_data_builder.rb
View file @
9d938fd7
...
@@ -27,6 +27,12 @@ module Gitlab
...
@@ -27,6 +27,12 @@ module Gitlab
# Get latest 20 commits ASC
# Get latest 20 commits ASC
commits_limited
=
commits
.
last
(
20
)
commits_limited
=
commits
.
last
(
20
)
# For performance purposes maximum 20 latest commits
# will be passed as post receive hook data.
commit_attrs
=
commits_limited
.
map
do
|
commit
|
commit
.
hook_attrs
(
project
)
end
type
=
Gitlab
::
Git
.
tag_ref?
(
ref
)
?
"tag_push"
:
"push"
type
=
Gitlab
::
Git
.
tag_ref?
(
ref
)
?
"tag_push"
:
"push"
# Hash to be passed as post_receive_data
# Hash to be passed as post_receive_data
...
@@ -49,17 +55,10 @@ module Gitlab
...
@@ -49,17 +55,10 @@ module Gitlab
git_ssh_url:
project
.
ssh_url_to_repo
,
git_ssh_url:
project
.
ssh_url_to_repo
,
visibility_level:
project
.
visibility_level
visibility_level:
project
.
visibility_level
},
},
commits:
[]
,
commits:
commit_attrs
,
total_commits_count:
commits_count
total_commits_count:
commits_count
}
}
# For performance purposes maximum 20 latest commits
# will be passed as post receive hook data.
commits_limited
.
each
do
|
commit
|
data
[
:commits
]
<<
commit
.
hook_attrs
(
project
)
end
data
[
:commits
]
=
""
if
data
[
:commits
].
count
==
0
data
data
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment