Feature Go To Commit
This feature adds a special button on the top right that allows you to navigate to a specific commit in the Git Graph from Git Diff Compare
Thanks for this PR. Generally a good idea, but it gives fuzzy results when viewing a diff of more than one commit. In case you have multiple changes in a file done by several commits - then it jumps only to the most recent commit. I can imagine that it could be extended in this way:
a) It jumps to the commit of the change where the cursor is located b) It could be done with the context menu (clicking on the changed line).
What do you think about that?
I followed option b) and made a few more fixes
The context menu feature does not work unfortunately:
https://github.com/user-attachments/assets/c3877f7d-5819-442d-87f5-0fcf51434d76
Oh, I have implemented the transition only between two files, go to the commit from the left file or go to the commit from the right file, if you narrow the two diff files to one file, then the URI of this file will be one and will contain only one commit, so I don't know how to fix it.
But as I see, you want another one, to implement the transition taking into account the commit line, that is, Line History, it is possible, it is available in GitLens, but not with my capabilities, it requires too many changes in the code and logic of Git Graph.
GitLens Example
Hmm then I don't really know how your feature should be used. Can you provide an explanation (short video maybe)?
Yes, it's simple, the feature performs the basic function of finding the commit of the file being compared. Here is an example video of how it is done without the feature and with the feature, instead of search manually, I created a button. If you want, I can add a more specific description like "Go to Commit this File"
https://github.com/user-attachments/assets/05dd58bb-3e99-4d36-9275-bec04346254a
What you suggest is already a separate feature, "Go to Commit this Line", and it needs a separate implementation function
Ah ok now I understand the feature. It has a slightly rare use case. I could imagine using it in those two scenarios together with Git Lens:
https://github.com/user-attachments/assets/ceb5a9f8-7bb0-4681-901a-7c2f1f15a055
BUT when you are already using Git Lens, then you can also use the integrated functionality of Git Lens:
https://github.com/user-attachments/assets/26fc0540-e2a9-4266-bad9-aabe4d9c89e5
I did this just to separate from Git Lens, I rarely use it lately, I even plan to remove Git Lens or replace it, it still has a convenient commit search and comparison of the two branches and it doesn't work in Workspaces (it gives an error), nevermind.
As for the Go To Commit feature, it can be used with any File History, for example build-in VS Code Timeline even has local commit changes. Very useful.
But I didn't have enough commit information to:
- See where this commit is in the graph
- See if there are changes to other files in the commit
That's why I use the Go To Commit button very often