Improve IntelliJ annotate (git blame)

倾然丶 夕夏残阳落幕 提交于 2019-12-10 03:46:56

问题


I'd like to improve the "annotate option" (right click on code line number colon -> annotate), which is similar to git blame (but integrated to IntelliJ).

1/ Is it possible ? (via plugin or raw modification of IntelliJ files ? something else ?)
2/ I'm on Android Studio (based on IntelliJ), will it be an issue ?
3/ If 1/ & 2/ are true, any tips on how to start ?

PS : My goal is not to display some commits (like "Reformat") in the annonate because they do not provide crucial informations about code history.


回答1:


IntelliJ doesn't implement its own logic for handling annotations. Instead it calls out to the git's native blame command.

By default, it uses the -w flag when making the fetch, so white-space-only changes to lines will be ignored in the output. Unfortunately, these options are hard-coded in the plugin, and cannot be adjusted by the user.

A cursory search yielded no results for another plugin that would provide additional options, but you could always submit a feature request for additional annotate options.

GUI designers tend to only bother providing easy access to the features and options necessary for daily operation by developers. They assume that if you need more power, or are a maintainer, you'll use the command line, which offers a lot more options any IDE can reasonably implement a GUI for.



来源:https://stackoverflow.com/questions/49402935/improve-intellij-annotate-git-blame

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!