Sertion / vscode-gitblame

Visual Studio Code Extension - See Git Blame info in status bar.
https://marketplace.visualstudio.com/items/waderyan.gitblame
MIT License
72 stars 31 forks source link

RFE: ability to launch a command instead of triggering an URL #133

Closed mikkorantalainen closed 12 months ago

mikkorantalainen commented 1 year ago

I sometimes need to dig history more to inspect the source after seeing a line in the editor. Right now the popup contains button "View" which triggers the URL to open with your default browser.

How about adding an ability to execute a command? I would set it to something like

git gui blame --line=${file.line.result} -- ${file.path}

because git gui blame has great features to got back in history for a single line or nearby context as needed.

Sertion commented 1 year ago

Hey Mikko! Thank you for the feature request.

Where should the command be executed and should it replace the online link with the command?

MKrasHarman commented 1 year ago

It is also would be great to be able to open the diff in the vscode itself.

Sertion commented 1 year ago

Hey MKHMN. That sounds like a separate feature request and one that is out of scope.

If you are looking for a git blame extension with a lot more features I think GitLens is the most feature rich one. I have not used it myself and I do not know if it can show git diffs in editor.

J-Sorenson commented 1 year ago

GitLens has become a tad glitchy in recent releases, and too many features are starting to become redundant with bult-in VS Code features. I suggest accompanying this GitBlame extension with Git History when you want to see changes in a file with the VS Code diff engine. The two extensions work together quite nicely. I'm starting to realize that any extension that tries to be "all the things" will quickly become bloated and unreliable.

dideler commented 1 year ago

I'm interested in seeing the full commit message (title and body for sure, diff less important) when clicking on the status bar without opening a URL. For example, it shows the full commit message within VSCode in the info popup (might not always be possible if there are char limits) or opens a new page in VSCode.

I'm commenting here because technically this use case can be solved with a custom command that loads another local tool. Though my preference would be to view the commit message within VSCode.

The reason why I think there should be an option to view locally alongside opening a URL is that the URL option is not always accessible. You may be working offline, the VCS host may be down, the origin repo might have been deleted, you might have lost access permissions, etc.

I tried installing additional git extensions alongside this one but they're all very bloated, both in terms of features and UI. The minimalist and read-only approach of this one suits me best.

Sertion commented 1 year ago

Sadly it is not (currently) possible to do line breaks in window.showInformationMessage. The options to display content in a non-intrusive way in vscode is currently a bit limited.

Sertion commented 12 months ago

After some thinking I've decided against allowing running a custom command from with in the extension, too many things to take into consideration surrounding it.

I've instead added the ability to run git show for the commit in the vscode build in terminal instead. I hope this fulfills the basics of the needs expressed in this issue.

The feature should be available in 10.4.0.