News for hackers. Stuff that matters.
Re:So You Think You Know Git – Git Tips and Tricks by Scott ... by wrs on Tuesday February 13, 2024 @12:32PM (#39360206)
In the part about whitespace diffs, you might want to mention ignore-revs-file [0]. We check an ignore-revs file into the repo, and anyone who does a significant reformat adds that SHA to the file to avoid breaking git-blame.

[0] https://git-scm.com/docs/git-blame#Documentation/git-blame.t...

Re:So You Think You Know Git – Git Tips and Tricks by Scott ... by schacon on Tuesday February 13, 2024 @12:44PM (#39360399)
I dont think I knew this. Great tip, thanks!
Re:So You Think You Know Git – Git Tips and Tricks by Scott ... by js2 on Tuesday February 13, 2024 @01:41PM (#39361119)
Note that git itself doesn't care what the ignore-revs file is called, but GitHub does. It has to be named `.git-blame-ignore-revs`:

https://github.blog/changelog/2022-03-24-ignore-commits-in-t...

One other thing you might want to be mention, which is obvious after thinking about it, is that updating the ignore-revs file has to occur in a commit after the one that you want to ignore, since you don't know what that first commit's ID is till after you make it. :-)

Re:So You Think You Know Git – Git Tips and Tricks by Scott ... by wrs on Tuesday February 13, 2024 @01:56PM (#39361302)
Yes! I recommend making a script that does that little dance automatically.