Investigating Code History
Plain git blame
In command line, to investigate commits which introduced a certain
piece of code, you can use git blame
:
git blame scripts/r.mask/r.mask.py
This will give you current content of the file with commit hash and author associated with each line.
Ignore some commits with git blame
Over the course of time, there was a lot of code reformatting changes which you typically want to ignore. These, often whitespace-only changes, can be filtered out using a ignore-revs file in the source code root directory:
git blame scripts/r.mask/r.mask.py --ignore-revs-file .git-blame-ignore-revs
In some cases, ignoring formatting changes may not be appropriate, for example
when investigating automated checks of formatting.
If you think the ignore-revs file contains commits which should be never
ignored with git blame
, please open an issue.
SOURCE CODE
Available at: investigating_history source code
(history)
Latest change: Tuesday Jun 03 08:05:08 2025 in commit 7fd42d6