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

Feature: Builtin git only display commits for current file and view file contents at selected commit #630

Closed
Pyons opened this issue Mar 8, 2021 · 2 comments
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@Pyons
Copy link

Pyons commented Mar 8, 2021

I want to be able to only see the commits and diff preview of the currently opened file.
Furthermore, on selection i don't want to do a git checkout, but view the open file in a new buffer at the time of the selected commit.

Solution
I created an extension telescope-git-ex.nvim
Which uses git show to retrieve the file at the selected commit and creates a new buffer with the content.
Maybe if you deem this feature useful enough, it could be integrated and further enhanced as this is just a proof of concept.

image
(Picker only displays commits featuring the open file)

image
(Opens a new buffer with the file at the selected commit)

@Pyons Pyons added the enhancement Enhancement to performance, inner workings or existent features label Mar 8, 2021
@Pyons Pyons changed the title Feature: Builtin git only display commits for current file and view file content at selected commit Feature: Builtin git only display commits for current file and view file contents at selected commit Mar 8, 2021
@Conni2461
Copy link
Member

Oh cool. I love seeing new extensions.

We already have Telescope git_bcommits which only shows commits with the current file, and i am almost done with #528, just one small thing missing, like 1/2 days. That will allow you to cycle thought different previewers and we will have a git diff to parent, diff to head, git show, git commit message previewer configured.

It will also have a diff view on <c-v>, <c-x> and <c-t> and i think bcommits will now checkout file (git checkout sha -- file) if i recall correctly

@Pyons
Copy link
Author

Pyons commented Mar 8, 2021

Thank you for the quick answer.
#528 looks great, i'm going to have a look at it.

Great project, by the way.

@Pyons Pyons closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

No branches or pull requests

2 participants