News for hackers. Stuff that matters.
Re:Julia Evans: Git rebase, what can go wrong by Lio on Monday November 06, 2023 @02:15PM (#38167361)
Git blame confuses people even without squash merges.

I've seen people forget to go back more than one commit and then blame the person who last indented a file instead of going back to the commit that actually wrote the code many times.

Re:Julia Evans: Git rebase, what can go wrong by erik_seaberg on Monday November 06, 2023 @02:53PM (#38167950)
We shouldn’t tamper with code we don’t actually need to fix, it’s not a good use of time and it makes history less useful. Just because it doesn’t look like I wrote it doesn’t make it wrong.
Re:Julia Evans: Git rebase, what can go wrong by Lio on Monday November 06, 2023 @03:07PM (#38168177)
I’m thinking of situations where the surrounding structure of the code has been changed to correct a problem.

That’s done by an automated tool. Correction of indentation is just a byproduct.

I don’t consider that “tampering”.

Re:Julia Evans: Git rebase, what can go wrong by WorldMaker on Monday November 06, 2023 @03:22PM (#38168411)
You can deal with that through tooling.

In a lot of my work I call those types of automated tool commits "wrench" commits personally and even have a simple shell script to help automate committing them. In my case I prefix the command line with a wrench emoji. At that point it's very obvious in git blame that if a line starts with a wrench it was last touched by an automated tool of some sort.

You can also very easily at that point grep your git log for wrenches to dump commit hashes into a git-ignore-revs file and automate that part too so that those commits don't even show up in git blame at all.

Re:Julia Evans: Git rebase, what can go wrong by sodapopcan on Monday November 06, 2023 @03:52PM (#38168826)
> I've seen people forget to go back more than one commit and then blame the person who last indented a file instead of going back to the commit that actually wrote the code many times.

I default my `git blame` to `git blame -w` which ignores whitespace commits. Though knowing how to jump back commits should be required knowledge.