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 git blame plugin #1302

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Add git blame plugin #1302

wants to merge 4 commits into from

Conversation

rdbende
Copy link
Collaborator

@rdbende rdbende commented Jun 28, 2023

Resolves #1289

@Akuli
Copy link
Owner

Akuli commented Jun 29, 2023

Maybe the blame functionality should be behind a right-click, so that it doesn't consume CPU power and e.g. make your laptop battery run out quicker.

@Moosems
Copy link
Contributor

Moosems commented Jun 29, 2023

Most other editors wait for a hover on a line to render or the first line selected/the insert location.

@rdbende
Copy link
Collaborator Author

rdbende commented Jun 29, 2023

Currently this doesn't do anything, simply prints the info, but yeah, I was wondering when it should actually show it, and where.

@Moosems
Copy link
Contributor

Moosems commented Jun 29, 2023

I would use the selection/insert and hover (if hover is possible with tkinter Text (maybe a tag_add but that adds more processing time).

@Akuli
Copy link
Owner

Akuli commented Jun 29, 2023

and where.

Found this screenshot of vscode online, IMO it's a pretty good option:

image

It assumes that the editor is wide enough to fit stuff to the side, but git blame needs a wide window in general, even on the terminal.

Maybe the best way to show the stuff would be to not actually insert something to the text widget, but add a label with the same font and background color as the text widget.

@Akuli
Copy link
Owner

Akuli commented Jun 29, 2023

Or maybe show the commits on the left side, similar to github (press b when looking at a file):

b

IMO it would be enough if copying the commit hashes to clipboard was easy, so that you can take the commit hash to terminal for git show or git checkout or git revert, for example.

@rdbende
Copy link
Collaborator Author

rdbende commented Jun 29, 2023

Inserting it to the text widget screws up the highlighting, so then I'll go with the label.

@rdbende
Copy link
Collaborator Author

rdbende commented Jul 8, 2023

And what about putting it in the status bar, next to the line and column numbers?

Line 12, column 34; changed by rdbende five months ago  this is a descriptive commit message

Then we don't have to worry about scrolling, and more text would fit on the screen. Although this way it would be kinda weird to have a timeout before the label appears.

@Moosems
Copy link
Contributor

Moosems commented Jul 9, 2023

In VS Code when you click on a git blame it will show the change on the line in a small popup, that would be cool to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git blame plugin
3 participants