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

Show history for selected lines #58

Open
fuine opened this issue May 13, 2017 · 8 comments
Open

Show history for selected lines #58

fuine opened this issue May 13, 2017 · 8 comments
Labels

Comments

@fuine
Copy link

fuine commented May 13, 2017

I don't know if it's even possible, but I would love to see some functionality that would allow me to see a tree for selected line(s). In your opinion, how hard would it be to implement this feature? I'd gladly help.

@dsummersl
Copy link
Collaborator

Great question - sort of like a git blame? Would this be as simple as supporting visual selections (filter out all undos from mundo that have anything to do with the current selection)?

@fuine
Copy link
Author

fuine commented May 14, 2017

Yes, that's how I primarily imagined it. A lot of the times I find myself trying to see how the specific block of code has changed over the time and currently I just end up moving down the tree, looking for the changes that contain any lines from said block.

@dsummersl
Copy link
Collaborator

I don't this would be too hard:

  • Support passing the selected line numbers to MundoRenderGraph()
  • Currently we're using python's builtin difflib library to generate the unified diffs...
    • We'd need to determine which lines are affected in the undo (filter appropriately)
    • As we process the undos, we'd need to keep a running line offset counter. For instance if one diff adds/removes X lines in front of the selected block we're interested in, we'd need to account for that as we go further on in the undo history.

I feel like parsing the unified diff output would be the easiest way to do these two things, but it might not be the most efficient.

@dsummersl
Copy link
Collaborator

@fuine unless you wanna take a crack at it, I'll give it a shot this week.

@fuine
Copy link
Author

fuine commented May 15, 2017

@dsummersl I could take on this issue, but not before the upcoming weekend. If you have a spare time however you could start hacking on that and I could help you. I'm not sure if that works for you but I'm pretty flexible in that regard

@dsummersl
Copy link
Collaborator

@fuine 👍 sounds good - I'll see what I can get done, you can take over or help code review. (or vice versa, if I completely drop the ball this week!)

@dsummersl
Copy link
Collaborator

Didn't get as much time as I wanted into this over the weekend, but I got a little. Wrote some more unit tests for graphlog, figured out where I think the changes could happen. I'll push up a branch when I get a little further along.

@fuine
Copy link
Author

fuine commented May 24, 2017

I'm sorry, looks like we have similar issues with time. If you have something written already please consider creating a WIP PR, as I might join in and hopefully help you.

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

No branches or pull requests

3 participants