Skip to content

Commit

Permalink
Leave the first line in, we're cleaning it in Perl now
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Baker committed Mar 3, 2016
1 parent d293ed7 commit 1113a59
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions diff-so-fancy
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ git_index_line_pattern="^($color_code_regex)index .*"

format_diff_header () {
# simplify the unified patch diff header
$SED -E "s/^($color_code_regex)diff --git .*$//g" \
| $SED -E "/$git_index_line_pattern/{N;s/$git_index_line_pattern\n//;}" \
$SED -E "/$git_index_line_pattern/{N;s/$git_index_line_pattern\n//;}" \
| $SED -E "s/^($color_code_regex)\-\-\-(.*)$/\1$(print_horizontal_rule)\\${NL}\1\-\-\-\-\5/g" \
| $SED -E "s/^($color_code_regex)\+\+\+(.*)$/\1\+\+\+\+\5\\${NL}\1$(print_horizontal_rule)/g"
}
Expand All @@ -53,10 +52,6 @@ mark_empty_lines () {
$SED -E "s/^$color_code_regex[\+\-]$reset_color\s*$/$invert_color\1 $reset_escape/g"
}

remove_first_empty_line () {
$SED -E '1 D'
}

strip_leading_symbols () {
# strip the + and -
$SED -E "s/^($color_code_regex)[\+\-]/\1 /g"
Expand All @@ -81,7 +76,6 @@ cat $input \
| format_diff_header \
| colorize_context_line \
| mark_empty_lines \
| remove_first_empty_line \
| strip_leading_symbols \
| strip_first_column \
| print_header_clean

0 comments on commit 1113a59

Please sign in to comment.