summaryrefslogtreecommitdiff
path: root/gitw
blob: 0f17645ada651cbfb00a137f3c0c0c63fffc38f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

git diff --no-prefix --no-ext-diff --relative -U0 |
awk '
/^\+\+\+ / {
  file = $2
  next
}

file && /^@@/ {
  match($0, /\+[0-9]+/)
  line = substr($0, RSTART + 1, RLENGTH - 1)
  next
}

line && /^[+-]/ {
  printf "%s:%d:%s\n", file, line, $0
  line = 0
}
'