How does `git blame -C -C -C` detect code moved between files?
AdvancedConceptGitHub features, history rewriting and scale
Answer
-M detects lines moved within a file and -C detects lines copied from other files modified in the same commit. Repeating -C widens the search: twice looks in the file-creating commit, three times looks in any commit. It is how blame attributes extracted functions to the original author rather than to the refactor commit.
git blame -w -M -C -C -C src/service.py
More on GitHub features, history rewriting and scale
What does a GitHub Actions workflow look like at a basic level?BeginnerWhat are GitHub environments and what protection do they offer?IntermediateWhat is a GitHub Release and how does it relate to a Git tag?BeginnerWhat are the permissions of `GITHUB_TOKEN` and how do you restrict them?IntermediateWhy do fork PRs get no secrets, and what is `pull_request_target`?AdvancedWhat is the difference between a GitHub fork and a clone?Beginner