this post was submitted on 30 Apr 2026
356 points (98.9% liked)

Programmer Humor

31237 readers
1738 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] kevincox@lemmy.ml 1 points 3 days ago

You seem to be making this very complex. But it really isn't. Yes, git doesn't track renames. So you are working around it by splitting your operation into 2 commits.

  1. A pure rename.
  2. A file change.

This way 1 is always considered a rename and 2 is just a regular file change with the same path. You may also consider tweaking the default rename detection threshold with flags like --find-renames or options like diff.renameLimit.

Would it be nice if Git tracked renames? Probably. But that isn't how the data model works so it is unlikely to happen soon. But maybe they could add some metadata.