kemayo / sublime-text-git

Plugin for some git integration into sublime text
MIT License
2.83k stars 391 forks source link

"git wtf" command: get a history of the current selection #547

Open rahim opened 6 years ago

rahim commented 6 years ago

sublime-git-wtf

This came about to scratch my own itch - it provides a counterpart to sublime-text-git's blame handling that summarises the history of a set of lines rather than surface noisier file level change information provided by "Git: Log Current File" or just the last commit message for each line from "Git: Blame".

It's a simple wrapper round git log -L - https://git-scm.com/docs/git-log#git-log--Lltstartgtltendgtltfilegt

I'd love to extend this to support following functions rather than line ranges, but this appears more involved - it's based on per language regexes to match the methods with language tailored defaults usually configured via .gitattributes (http://urbanautomaton.com/blog/2014/09/22/tracking-method-history-in-git/). It's probably easiest to duplicate those regexes in to plugin itself. It's also not entirely clear to me what would be the ideal UX for choosing method over range.

Hopefully the naming isn't too abrasive... 😃

adrianogil commented 3 years ago

I've tested in my repo, It works as a charm!