-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDiffHeader.regex.txt
18 lines (18 loc) · 1.02 KB
/
DiffHeader.regex.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Matches Header information from the output of git diff
(?m)^diff # diff line start
\s--git\s # whitespace, then --git, then whitespace
(?<From>\S+) # From
\s # Whitespace
(?<To>\S+) # To
(?<ExtendedHeader>(?:.|\s){0,}?(?=\z|^index)) # Until 'index'
^index\s # Index Line Start
(?<FromHash>\w+) # FromHash
\.{2,2} # DotDot
(?<ToHash>\w+) # ToHash
\s(?<Mode>\w+) # FileMode
(?:.|\s){0,}?(?=\z|^---) # UntilDashLine
\-{3,3}\s # DashLineAndWhitespace
(?<FromUnified>\S+) # FromUnified
\s+\+{3,3}\s # PlusLineAndWhitespace
(?<ToUnified>\S+) # ToUnified
\s