![]() ![]() That calculates the blame given the state of the file at the provided commit (or HEAD if no commit is given). The wrapper library is from the open-source project GitAhead also developed at Scitools.Ĭalculating a blame ultimately uses the libgit2 function git_blame_file. What happens when you start actively editing this file? Understand uses a wrapper library around libgit2 for Git access. Additional information is provided by hovering: The Blame margin as it currently exists in Understand. It’s not resizable, but at least it’s small. The width is two characters, allowing for initials. That puts it on the left side of the view and gives it a defined width. So, for Understand, we decided to show the blame as a margin. It’s too much space for an always-on feature. My personal grievance with most of the views is how much (non-resizable) space the blame information takes. The common theme involves splitting the editor with text on one side and the blame information on the other side. (c) A full blame margin is also available. (b) Hovering over that blame information brings up more detailed information. ![]() (a) An inline blame shows summary information for the current line. There’s also our open-source tool GitAhead: A Git Blame for the same file shown in GitAhead.Īnd Visual Studio Code: Git Blame information as shown in Visual Studio Code with the GitLens plugin. What immediately comes to my mind is how I’ve seen them on GitHub: A Git Blame shown from GitHub. Given the usefulness of blames, the next question is how to display them. So a comment tends to tell me what the code is doing whereas the commit message tends to explain why the code is needed. My commit messages are things like “Fix macro display in compare entities. At least, my comments tend to read more like section headers (“populate table” followed by 3-20 lines of code). The last commit to touch a line is often more useful than a comment. And, most of the time I’m looking at the blame to understand the code rather than to fix a bug. Accusing the programmers who have been around longer than me doesn’t usually work out very well. Personally, I rarely use blame to accuse people. Was the purpose of the command to accuse people? Actually, a blame shows the last commit that changed a given line. I’ve always thought that “git blame” sounded a little mean. ![]() Abstract: The origin of the Blame margin in Understand. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |