summaryrefslogtreecommitdiff
path: root/streaming.c
diff options
context:
space:
mode:
authorLibravatar Michał Kiedrowicz <michal.kiedrowicz@gmail.com>2012-04-11 23:18:40 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-04-11 14:26:01 -0700
commitd21102c9ffd6beb0408693b6f1b633f8e494c921 (patch)
tree07369025d32ad0ab1afac757089779f8e71568af /streaming.c
parentgitweb: Pass esc_html_hl_regions() options to esc_html() (diff)
downloadtgif-d21102c9ffd6beb0408693b6f1b633f8e494c921.tar.xz
gitweb: Extract print_sidebyside_diff_lines()
Currently, print_sidebyside_diff_chunk() does two things: it accumulates diff lines and prints them. Accumulation may be used to perform additional operations on diff lines, so it makes sense to split these two things. Thus, whole code that formats and prints diff lines in the 'side-by-side' manner is moved out of print_sidebyside_diff_chunk() to a separate subroutine and two conditions that control printing diff liens are merged. Thanks to that, we can easily (in later patches) replace call to that subroutine with a call to more generic print_diff_lines() that will control whether 'inline' or 'side-by-side' diff should be printed. As a side effect, context lines are printed just before printing added and removed lines, and at the end of chunk (previously, they were printed immediately on the class change). However, this doesn't change gitweb output. The outcome of this patch is that print_sidebyside_diff_chunk() is now much shorter and easier to read. While at it, drop the '# assume that it is change' comment. According to Jakub Narębski: What I meant here when I was writing it that they are lines that changed between two versions, like '!' in original (not unified) context format. We can omit this comment. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'streaming.c')
0 files changed, 0 insertions, 0 deletions