-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCommit.regex.txt
More file actions
12 lines (11 loc) · 825 Bytes
/
Commit.regex.txt
File metadata and controls
12 lines (11 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
# Matches Output from git commit
(?m)\[ # Initial Bracket
(?<Branch>\S+) # Followed by the branch
\s # then whitespace
(?<CommitHash>[^\]]+) # and then the commit hash
(?:.|\s){0,}?(?=\z|^\s\d) # Match until a line that starts with a digit
^\s(?<FilesChanged>\d+) # That digit is the number of files changed
(?:.|\s){0,}?(?=\z|\d+(?:.|\s){0,}?(?=\z|\+)) # Match until a digit, then until +
(?<Insertions>\d+) # That digit is the number of insertions
(?:.|\s){0,}?(?=\z|\d+(?:.|\s){0,}?(?=\z|-)) # Match until a digit, then until -
(?<Deletions>\d+) # That digit is the number of deletions