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 support for recursive blame #2285

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kanielrkirby
Copy link

@kanielrkirby kanielrkirby commented Jul 1, 2024

This Pull Request closes #2194.

It changes the following:

  • Replace BlameFilePopup.blame: Option<BlameProcess> with BlameFilePopup.blame_stack: Vec<BlameProcess>. This involved changing any references to it, which happened to be a fair amount.
  • Add keybinding for going back to a previous blame (b).
  • Make keybinding for blame (Shift+B) work in the popups/blame_file.rs view, where it will take the commit and open a blame from that.
  • Add hints for blame and back keybindings in blame_file.
  • (edit) Add recursive blame feature to popups/file_revlog.rs

I followed the checklist:

  • I added unittests (can add if you think it's necessary)
  • I ran make check without errors (this reached the same point master does, which fails on test_pre_commit_py. Does this need an issue?)
  • I tested the overall application (used it to make these commits! Haha)
  • I added an appropriate item to the changelog

Kaniel Kirby added 7 commits July 1, 2024 13:21
- Replaces `BlameFilePopup.blame: Option<BlameProcess>` with `BlameFilePopup.blame_stack: Vec<BlameProcess>`.
- Adds keybinding for going back from a blame (`b`).
- Makes keybinding for `blame` (`Shift+B`) work in the `popups/blame_file.rs` view, where it will take the commit and open a blame from that.
@@ -93,7 +93,7 @@ pub struct BlameFilePopup {
table_state: std::cell::Cell<TableState>,
key_config: SharedKeyConfig,
current_height: std::cell::Cell<usize>,
blame: Option<BlameProcess>,
blame_stack: Vec<BlameProcess>,
Copy link
Owner

Choose a reason for hiding this comment

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

I would like us to not keep this stack around. @cruessler and I agreed on working out an asynchronous blaming that will deliver results iteratively so the worst case scenarios are not as slow anymore and this stack will save a lot of data when going only in one direction through the blame history and only optimize for going back fast and not going back and forth.

Furthermore I have a gut feeling that it might lead to weird stacks when jumping to a file history from a blame and then to another blame again which will not properly reset the stack

Copy link
Author

Choose a reason for hiding this comment

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

Ah, that makes sense. So, to clarify, do you want to a) have somewhat of a non-popping stack, b) just nix the back functionality altogether, or c) did you have something else in mind?

Copy link
Author

Choose a reason for hiding this comment

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

Just a friendly ping :)
@extrawurst

@extrawurst
Copy link
Owner

Thanks for tackling this. I only had one comment or request to rework. Would love to add this feature

@extrawurst
Copy link
Owner

lets fix the ci, and i noticed that when the popup is open the command bar goes blank, that seems wrong

@kanielrkirby
Copy link
Author

lets fix the ci, and i noticed that when the popup is open the command bar goes blank, that seems wrong

Will get on that when I get a chance! Appreciate the update.

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.

Support for recursive blame
2 participants