Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to blame files #5721

Merged
merged 20 commits into from
Apr 20, 2019
Merged

Add option to blame files #5721

merged 20 commits into from
Apr 20, 2019

Conversation

andrzejressel
Copy link
Contributor

@andrzejressel andrzejressel commented Jan 13, 2019

Introduces option to blame text files.

2019-01-18-202408_1191x910_scrot

closes #747

Regarding https://github.com/go-gitea/gitea/pull/5721/files#diff-4c18d74f0d0687b8503915779673f3ebR393 - width was set to 1%, but it seems to scale anyway.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 13, 2019
@codecov-io
Copy link

codecov-io commented Jan 13, 2019

Codecov Report

Merging #5721 into master will decrease coverage by 0.07%.
The diff coverage is 22.6%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5721      +/-   ##
=========================================
- Coverage   40.87%   40.8%   -0.08%     
=========================================
  Files         416     418       +2     
  Lines       57013   57274     +261     
=========================================
+ Hits        23303   23368      +65     
- Misses      30589   30783     +194     
- Partials     3121    3123       +2
Impacted Files Coverage Δ
routers/repo/blame.go 0% <0%> (ø)
routers/routes/routes.go 82.29% <100%> (+0.11%) ⬆️
models/git_blame.go 78.26% <78.26%> (ø)
models/gpg_key.go 54.72% <0%> (+0.83%) ⬆️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9d1fb6...3a57b9c. Read the comment docs.

@lafriks
Copy link
Member

lafriks commented Jan 13, 2019

Even though I don't like current approach of git methods being in different repository but to be consistent git operations should be moved to go-gitea/git probably

routers/repo/blame.go Show resolved Hide resolved
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya! Thanks for your first PR. It's a good idea to add this functionality, but see my comments.

models/git_blame.go Outdated Show resolved Hide resolved
models/git_blame.go Outdated Show resolved Hide resolved
routers/repo/blame.go Outdated Show resolved Hide resolved
routers/repo/blame.go Show resolved Hide resolved
@techknowlogick techknowlogick added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jan 14, 2019
@jonasfranz
Copy link
Member

Do you consider adding screenshots to this PR?

@andrzejressel
Copy link
Contributor Author

@jonasfranz Done

@silverwind
Copy link
Member

Screenshot feedback:

  1. The black lines introduce too much contrast, I'd try #888 or similar.
  2. The right side of the file header looks weird. Try to get the content on 1 line and add some margins, especially to the right side of the buttons.

@MarkusAmshove
Copy link
Contributor

Does this work 'recursive, e.g. clicking on a commit on the left side opens a blame of this file with the context of the commit?

@stale
Copy link

stale bot commented Apr 4, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 4, 2019
@tonivj5
Copy link
Contributor

tonivj5 commented Apr 7, 2019

Any news?

@stale stale bot removed the issue/stale label Apr 7, 2019
@lafriks lafriks added this to the 1.9.0 milestone Apr 7, 2019
@lafriks
Copy link
Member

lafriks commented Apr 7, 2019

Resolved conflicts and updated UI

attels

@lafriks
Copy link
Member

lafriks commented Apr 7, 2019

Added author icons:

attels

@lafriks
Copy link
Member

lafriks commented Apr 7, 2019

@lunny @zeripath please review

@MarkusAmshove
Copy link
Contributor

Do the links in the blame view go to the commit (e.g. show an overview of that particular commit) or to the same file in the clicked commit, opening the blame view again?
The latter one would be really helpful (maybe with an extra button), because it makes it easier to actually blame across multiple commits

@zeripath
Copy link
Contributor

zeripath commented Apr 7, 2019

OK this is still rendering the whole blame in memory but I guess we can probably fix this later and get it more efficient once it's in.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 7, 2019
"strings"

"code.gitea.io/gitea/models"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary blank line.

@lunny
Copy link
Member

lunny commented Apr 8, 2019

@lafriks I think we also need commit time with the author?

@silverwind
Copy link
Member

Few ideas:

  • Make the blame column font non-monospaced.
  • Make the blame column a bit wider to let more of the message show.
  • Add relative commit date in the blame column or tooltip.
  • Add user-select: none to the blame column to allow copying only code.

Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
andrzejressel and others added 13 commits April 19, 2019 19:31
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
@lafriks
Copy link
Member

lafriks commented Apr 19, 2019

Fixed conflicts, added commit time and made blame info not selectable:
attels

@lafriks
Copy link
Member

lafriks commented Apr 19, 2019

@lunny please review

@lunny
Copy link
Member

lunny commented Apr 20, 2019

@jereksel @lafriks good work. If you can move git parts to modules/git, that's better. I will not block this PR, but since git module merged to main repository. That maybe not difficult.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 20, 2019
@techknowlogick techknowlogick merged commit 469d9b7 into go-gitea:master Apr 20, 2019
@techknowlogick techknowlogick added the type/changelog Adds the changelog for a new Gitea version label Apr 20, 2019
@6543
Copy link
Member

6543 commented Jan 11, 2020

there is a bounty for this PR: https://www.bountysource.com/issues/41291710-feautre-request-git-blame

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feautre Request: Git Blame