Last active
September 26, 2025 08:09
-
-
Save paoloricciuti/f355d2e6111817d1b8194e1c0488a9cf to your computer and use it in GitHub Desktop.
snippet to find the changed files from a git patch
This file contains hidden or 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
| const files = [...patch.matchAll(/^diff --git\sa\/(?<file>.+?)\sb\/\1\n(?:(?<action>deleted|new)\sfile mode)?/gm)].map(res => res.groups); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment