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

Conversation

@jereksel
Copy link
Contributor

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 label Jan 13, 2019

@codecov-io

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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
@zeripath
Copy link
Contributor

left a comment

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
@jonasfranz

This comment has been minimized.

Copy link
Member

commented Jan 16, 2019

Do you consider adding screenshots to this PR?

@jereksel

This comment has been minimized.

Copy link
Contributor Author

commented Jan 18, 2019

@silverwind

This comment has been minimized.

Copy link
Contributor

commented Jan 20, 2019

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

This comment has been minimized.

Copy link

commented Feb 3, 2019

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

This comment has been minimized.

Copy link

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 stale label Apr 4, 2019

@tonivj5

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2019

Any news?

@stale stale bot removed the stale label Apr 7, 2019

@lafriks lafriks force-pushed the jereksel:blame branch from 1a95861 to b27f016 Apr 7, 2019

@lafriks lafriks added this to the 1.9.0 milestone Apr 7, 2019

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

Resolved conflicts and updated UI

attels

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

Added author icons:

attels

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

@lunny @zeripath please review

@MarkusAmshove

This comment has been minimized.

Copy link

commented Apr 7, 2019

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

This comment has been minimized.

Copy link
Contributor

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 and removed lgtm/need 2 labels Apr 7, 2019

"strings"

"code.gitea.io/gitea/models"

This comment has been minimized.

Copy link
@lunny

lunny Apr 8, 2019

Member

unnecessary blank line.

@lunny

This comment has been minimized.

Copy link
Member

commented Apr 8, 2019

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

@silverwind

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2019

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.

jereksel added some commits Jan 13, 2019

Add file blame
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Remove app.ini
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>

jereksel and others added some commits Jan 13, 2019

Properly rebase to master
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Adding docs
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
make fmt
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Fix typo
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Header, BlameReader
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Cleaning
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>
Move html generation to one for
Signed-off-by: Andrzej Ressel <jereksel@gmail.com>

@lafriks lafriks force-pushed the jereksel:blame branch from 8199bb7 to 2ac60a5 Apr 19, 2019

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

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

@lafriks

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

@lunny please review

@lafriks lafriks force-pushed the jereksel:blame branch from 5bdaaa7 to b719773 Apr 19, 2019

lafriks added some commits Apr 19, 2019

@lunny

This comment has been minimized.

Copy link
Member

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.

@lunny

lunny approved these changes Apr 20, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Apr 20, 2019

@techknowlogick techknowlogick merged commit 469d9b7 into go-gitea:master Apr 20, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.