Skip to content

Instantly share code, notes, and snippets.

@ble
Created February 27, 2020 17:01
Show Gist options
  • Save ble/7b2a3788d2a17c4f5d5d35fdd024b2cf to your computer and use it in GitHub Desktop.
Save ble/7b2a3788d2a17c4f5d5d35fdd024b2cf to your computer and use it in GitHub Desktop.
A functional, but not edgecase-safe, regex for rewriting a path in git patches
Yeouch! If it's not clear to you that this is a dangerous hack, ask a friend or a coworker why rewriting git patches is probably not what you want!
\(a\/\|b\/\|^ create mode \d\+ \|^ rename \|=> \|^rename \(from \|to \)\)\@<=$PATH_IN_QUESTION/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment