The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Inspect code history and authors with "git blame
1. Using the “git blame” feature
Using the history view and filtering the history is a useful tool for inspecting project history.
However, if you look at a particular file and find a bug in a particular code line you would like to
instantly know who was the last person who changed this line of code. Additionally, you would
like to know why the developer did that i.e. locate the commit in which the change was done.
In Git, this feature is called “git blame” or “git annotate”.
Git Blame on a checked out version
● In Eclipse open a file for which you would like to see the Git annotations. For example,
open the Calculator.java from the example project.
● Right-click the left margin in the editor and choose Show Annotations
● A new “annotations” column appears in the editor window
2. ● Right click the “annotations” column and choose Revisions > Show Author
● Now, for each line of the code you know who last changed it
● Keep the mouse over an annotation for a couple of seconds. A window pops up showing
the info about the commit in which this line was changed together of the change which
was done in this commit in the vicinity of this line.