Skip to content

Instantly share code, notes, and snippets.

@dustinsoftware
Created September 7, 2022 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinsoftware/edc26fb9c5938a01f540a481a7e1f9fd to your computer and use it in GitHub Desktop.
Save dustinsoftware/edc26fb9c5938a01f540a481a7e1f9fd to your computer and use it in GitHub Desktop.
FindDeletions
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