News for hackers. Stuff that matters.
Re:Git Blame-Someone-Else by nasretdinov on Sunday June 04, 2023 @04:13AM (#36183923)
The only downside of this script is that it changes commit hashes, so you actually can only blame someone else if you force-push or just showing blame on your computer. It would be nice if it could be done without changing the commit SHAs.
Re:Git Blame-Someone-Else by ditsuke on Sunday June 04, 2023 @05:43AM (#36184316)
That could've been possible if Git didn't use commit metadata hashes, (un)fortunately it's smart enough to do that.
Re:Git Blame-Someone-Else by proto_lambda on Sunday June 04, 2023 @06:16AM (#36184437)
The whole point of commit hashes is that you can't do that, so no, being able to change history undetected would not be nice at all.
Re:Git Blame-Someone-Else by MrGagi on Sunday June 04, 2023 @06:19AM (#36184444)
But funny enough is that there is a commit where it pretends to be Linus https://github.com/jayphelps/git-blame-someone-else/commit/e...
Re:Git Blame-Someone-Else by aae42 on Sunday June 04, 2023 @06:37AM (#36184518)
This is why I sign my commits... It's also easy these days to do it with an SSH key
Re:Git Blame-Someone-Else by aflag on Sunday June 04, 2023 @06:37AM (#36184519)
Initially I thought it would show all changes to a file that were made by someone other than the person running the command. So, for instance, if there's a line I changed recently, it would go down history further to find the original author.
Re:Git Blame-Someone-Else by Tyr42 on Sunday June 04, 2023 @06:40AM (#36184542)
* * *
Re:Git Blame-Someone-Else by saagarjha on Sunday June 04, 2023 @06:49AM (#36184584)
It's actually a pretty convenient script to use locally when doing repository manipulation, for example when you're cherry-picking other people's commit via patch and want to attribute it to them.
Re:Git Blame-Someone-Else by ahrzb on Sunday June 04, 2023 @07:00AM (#36184632)
But changing commit author is quite easy with git, just do: ‘git commit -a —author “<name+email>”’
Re:Git Blame-Someone-Else by saagarjha on Sunday June 04, 2023 @07:48AM (#36184868)
I often need to change the author on commits that aren't the topmost one.
Re:Git Blame-Someone-Else by rurban on Sunday June 04, 2023 @08:21AM (#36185048)
Then do it via rebase -i and e. I do that constantly,
Re:Git Blame-Someone-Else by saagarjha on Tuesday June 06, 2023 @08:38AM (#36211711)
Yeah, but that's more annoying ;)