The 'Statistics (Lines Added/Removed)' command in the Diff bundle works by counting + and - characters in the first column. The current count includes the '---' and '+++' that unified diffs have in the first two lines.
The fix is to skip the first two lines.
On 9. Nov 2006, at 23:56, Grant Hollingworth wrote:
The 'Statistics (Lines Added/Removed)' command in the Diff bundle works by counting + and - characters in the first column. The current count includes the '---' and '+++' that unified diffs have in the first two lines.
The fix is to skip the first two lines. <Statistics (Lines Added:Removed).tmCommand>
Thanks, unfortunately for e.g. svn diff, there are two lines above the +++/--- lines. So it seems a better approach would be to explicitly match the lines (and exclude them, i.e. grep -v). That should also make it work with diffs that have patches for multiple files.
* Allan Odgaard throw-away-1@macromates.com [2006-11-10 04:13]:
Thanks, unfortunately for e.g. svn diff, there are two lines above the +++/--- lines. So it seems a better approach would be to explicitly match the lines (and exclude them, i.e. grep -v). That should also make it work with diffs that have patches for multiple files.
Good point. So something like egrep -v '^(+++|---) ' would be better. There's still the unlikely case that someone has added a line that starts with two pluses and a space, or removed a line that starts with two dashes and a space.
Matching more of those lines is tricky. It's a path and then a date (or a revision for Subversion). Pretty vague.
On 10. Nov 2006, at 16:59, Grant Hollingworth wrote:
Thanks, unfortunately for e.g. svn diff, there are two lines above the +++/--- lines. So it seems a better approach would be to explicitly match the lines (and exclude them, i.e. grep -v). That should also make it work with diffs that have patches for multiple files.
Good point. So something like egrep -v '^(+++|---) ' would be better. There's still the unlikely case that someone has added a line that starts with two pluses and a space, or removed a line that starts with two dashes and a space.
I added you suggested grep, thanks!