Created
September 7, 2022 14:45
-
-
Save dustinsoftware/edc26fb9c5938a01f540a481a7e1f9fd to your computer and use it in GitHub Desktop.
FindDeletions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function FindDeletions($name) { | |
$matches = Invoke-Expression "git grep -i ""$name""" | |
if ($matches) { | |
return | |
} | |
$latestMatch = Invoke-Expression "git --no-pager log --format=format:%H -n 1 -i -S ""$name""" | |
if ($latestMatch) { | |
Write-Host "Found deletion: $name at commit $latestMatch" | |
return | |
} | |
Write-Host "Warning: Could not find any instances in the git log of: $name" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment