Live data from Hacker News

Git-blame-someone-else

github.com

81–90 of 100 posts

Re: Git-blame-someone-else

#81

I've always thought 'git blame' was a badly named command. The word 'blame' has such negativity attached to it. The command should have been called 'git who'.

'git blame' is an excellent name, because who write a piece of code shouldn't matter. For a coder that's ready to take responsibility, figuring out who did what doesn't matter. All that matters what the code is now, whether it serves the purpose of the software and whether/how it should be changed.

I've never needed to use 'git blame' and I see no reason to, unless you really are just trying to look for a person to blame.

Re: Git-blame-someone-else

#82
post #81

I've always thought 'git blame' was a badly named command. The word 'blame' has such negativity attached to it. The command should have been called 'git who'.

'git blame' is an excellent name, because who write a piece of code shouldn't matter. For a coder that's ready to take responsibility, figuring out who did what doesn't matter. All that matters what the code is now, whether it serves the purpose of the software and whether/how it should be changed. I've never needed to use 'git blame' and I see no reason to, unless you really are just trying to look for a person to b…

It's very useful to figure out who to ask about a particular piece of code. It's also occasionally useful to track down when it was changed (what commit) to give context for why things are the way they are.

Re: Git-blame-someone-else

#83
post #82
post #81

Earlier quoted context omitted.

'git blame' is an excellent name, because who write a piece of code shouldn't matter. For a coder that's ready to take responsibility, figuring out who did what doesn't matter. All that matters what the code is now, whether it serves the purpose of the software and whether/how it should be changed. I've never needed to use 'git blame' and I see no reason to, unless you really are just trying to look for a person to b…

It's very useful to figure out who to ask about a particular piece of code. It's also occasionally useful to track down when it was changed (what commit) to give context for why things are the way they are.

If the person who always has trouble with boundary conditions wrote the code, then I can assume the missing boundary condition was accidental, not some subtle “feature” that I need to out-clever.

Also if the code is from a time frame before we agreed to stop writing code a certain way, that’s one thing. If it’s new, the person needs some feedback.

Re: Git-blame-someone-else

#84
post #82
post #81

Earlier quoted context omitted.

'git blame' is an excellent name, because who write a piece of code shouldn't matter. For a coder that's ready to take responsibility, figuring out who did what doesn't matter. All that matters what the code is now, whether it serves the purpose of the software and whether/how it should be changed. I've never needed to use 'git blame' and I see no reason to, unless you really are just trying to look for a person to b…

It's very useful to figure out who to ask about a particular piece of code. It's also occasionally useful to track down when it was changed (what commit) to give context for why things are the way they are.

Seconded! I am the sole contributor (or the main one) on most of the git repos I am working on--they are research prototypes and I'm a PhD student so it's mostly solo work. So, I'm the only person to "blame" when looking at a piece of code, but it is a useful command that lets me find the commit and the context for why I implemented an algorithm in a certain way after a few months.

Another example: I use the nightly Rust compiler as a library, which have unstable API. git-blame helped track down which commits change the APIs I use when I'm updating the compiler version my project depends on. git-bisect is the other useful part of git for this purpose.

Re: Git-blame-someone-else

#85

I've always thought 'git blame' was a badly named command. The word 'blame' has such negativity attached to it. The command should have been called 'git who'.

You can always alias it to "git praise".

git config --global alias.praise blame

Re: Git-blame-someone-else

#86
post #66

Earlier quoted context omitted.

As someone else is saying, its obviously a joke. Even a halfway intelligent person would be able to create an alibi that they didnt do it.

Of course they didn’t do it. It was somebody else.

You must be halfway intelligent!

Re: Git-blame-someone-else

#87

Stop using git blame to look up who authored code, it's not a useful tool. Use git log -S to search for changes to that line (then repeat with the previous version of that line, until you find the original author), and/or git log -L to track changes to a code block. Don't waste your time with git blame.

My editor (sublime text) has built in git blame support. It's literally right-click -> blame file, and it will put the author of every line in the margin.

and?

Re: Git-blame-someone-else

#88

Stop using git blame to look up who authored code, it's not a useful tool. Use git log -S to search for changes to that line (then repeat with the previous version of that line, until you find the original author), and/or git log -L to track changes to a code block. Don't waste your time with git blame.

how is git log -S more efficient? You have to write whole line, what if line is long? What if you need to look at several lines within some range. git blame is much better than your git log -S

you... copy and paste it?

Re: Git-blame-someone-else

#90
post #7

I runned a code formatter in our code base. Years later I was still 'blamed' for many things in our code as few files were untouched.

We recently converted our monolith codebase at work from windows-1252 encoding to UTF-8 and now the entire project looks like it was written by 1 guy

You had non-ASCII characters in every line?
Post reply on HN