summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/stylesheets/generic/files.scss7
-rw-r--r--app/assets/stylesheets/pages/tree.scss4
-rw-r--r--app/controllers/projects/blame_controller.rb2
-rw-r--r--app/views/projects/blame/show.html.haml34
6 files changed, 29 insertions, 24 deletions
diff --git a/Gemfile b/Gemfile
index c2d618f41de..2483a7d24a3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -38,7 +38,7 @@ gem "browser", '~> 0.8.0'
# Extracting information from a git repository
# Provide access to Gitlab::Git library
-gem "gitlab_git", '~> 7.2.11'
+gem "gitlab_git", '~> 7.2.12'
# Ruby/Rack Git Smart-HTTP Server Handler
# GitLab fork with a lot of changes (improved thread-safety, better memory usage etc)
diff --git a/Gemfile.lock b/Gemfile.lock
index 9c3a8e763a5..27535be46ef 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -271,7 +271,7 @@ GEM
mime-types (~> 1.19)
gitlab_emoji (0.1.0)
gemojione (~> 2.0)
- gitlab_git (7.2.11)
+ gitlab_git (7.2.12)
activesupport (~> 4.0)
charlock_holmes (~> 0.6)
gitlab-linguist (~> 3.0)
@@ -783,7 +783,7 @@ DEPENDENCIES
gitlab-grack (~> 2.0.2)
gitlab-linguist (~> 3.0.1)
gitlab_emoji (~> 0.1)
- gitlab_git (~> 7.2.11)
+ gitlab_git (~> 7.2.12)
gitlab_meta (= 7.0)
gitlab_omniauth-ldap (= 1.2.1)
gollum-lib (~> 4.0.2)
diff --git a/app/assets/stylesheets/generic/files.scss b/app/assets/stylesheets/generic/files.scss
index 8014dcb165b..f845342c67b 100644
--- a/app/assets/stylesheets/generic/files.scss
+++ b/app/assets/stylesheets/generic/files.scss
@@ -90,12 +90,7 @@
border-right: none;
}
background: #fff;
- padding: 5px;
- }
- .author,
- .blame_commit {
- background: $background-color;
- vertical-align: top;
+ padding: 8px;
}
.lines {
pre {
diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss
index 34ee4d7b31e..092918e4de1 100644
--- a/app/assets/stylesheets/pages/tree.scss
+++ b/app/assets/stylesheets/pages/tree.scss
@@ -89,6 +89,10 @@
td.blame-commit {
background: #f9f9f9;
min-width: 350px;
+
+ .commit-author-link {
+ color: #888;
+ }
}
td.blame-numbers {
pre {
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb
index 3362264dcce..45e157c90cb 100644
--- a/app/controllers/projects/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -7,7 +7,7 @@ class Projects::BlameController < Projects::ApplicationController
before_action :authorize_download_code!
def show
+ @blob = @repository.blob_at(@commit.id, @path)
@blame = Gitlab::Git::Blame.new(@repository, @commit.id, @path)
- @blob = @blame.blob
end
end
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
index 8019c7f4569..05d5db5d3fe 100644
--- a/app/views/projects/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -12,25 +12,31 @@
= render "projects/blob/actions"
.file-content.blame.highlight
%table
- - @blame.each do |commit, lines, since|
- - commit = Commit.new(commit, @project)
+ - current_line = 1
+ - @blame.each do |raw_commit, line|
%tr
%td.blame-commit
- %span.commit
- = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit_short_id"
- &nbsp;
- = commit_author_link(commit, avatar: true, size: 16)
- &nbsp;
- = link_to_gfm truncate(commit.title, length: 20), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "row_title"
+ .commit
+ - unless @prev_commit && @prev_commit.sha == raw_commit.sha
+ - commit = Commit.new(raw_commit, @project)
+ .commit-row-title
+ %strong
+ = link_to_gfm truncate(commit.title, length: 35), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "cdark"
+ .pull-right
+ = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "monospace"
+ &nbsp;
+ .light
+ = commit_author_link(commit, avatar: false)
+ authored
+ #{time_ago_with_tooltip(commit.committed_date)}
+ - @prev_commit = raw_commit
%td.lines.blame-numbers
%pre
- - (since...(since + lines.count)).each do |i|
- = i
- \
+ = current_line
+ - current_line += 1
%td.lines
%pre{class: 'code highlight white'}
%code
:erb
- <% lines.each do |line| %>
- <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %>
- <% end %>
+ <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %>
+