]> Lady’s Gitweb - Gitweb/commit
gitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring
authorJakub Narebski <redacted>
Sat, 18 Nov 2006 22:35:39 +0000 (23:35 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
commit2be815bf7c4f96194aa9dfeb007aceb67e1e69eeeee2608835d520580d9d1178
treeee44021b11de718c05a630449f90bb26b41df712d38684ce6c6941d1fc367661
parent20e0ba5af98bb88e94fc0a714baf9e288e7a3bf20f7d3c0352e3b8b6d895da48
gitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring

There are some cases when one line from "raw" git-diff output (raw format)
corresponds to more than one patch in the patchset git-diff output. To deal
with this buffer git diff header and extended diff header (everything up to
actual patch) to check from information from "index <hash>..<hash>" extended
header line if the patch corresponds to the same or next difftree raw line.

This could also be used to gather information needed for hyperlinking, and
used for printing gitweb quoted filenames, from extended diff header instead
of raw git-diff output.

While at it, refactor git_patchset_body subroutine from the event-driven,
AWK-like state-machine parsing to sequential parsing: for each patch
parse (and output) git diff header, parse extended diff header, parse two-line
from-file/to-file diff header, parse patch itself; patch ends with the end
of input [file] or the line matching m/^diff /.

For better understanding the code, there were added assertions in the
comments a la Carp::Assert module. Just in case there is commented out code
dealing with unexpected end of input (should not happen, hence commented
out).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.204659 seconds and 4 git commands to generate.