]> Lady’s Gitweb - Gitweb/commit
gitweb: Split git_patchset_body into separate subroutines
authorJakub Narebski <redacted>
Fri, 8 Jun 2007 11:27:42 +0000 (13:27 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
commit822aa107e690688e517dbfc7279c4900fee92700ef9bed2f8e2bdd78d9631d0d
tree4e9c7324f2777317787acd22fefd080eb6bc90305c077c5ed338970c48a6eb9d
parent612d138d17e6177be48b34b838fd570289ba15c2d38b9c8c04b56a72b1389d3c
gitweb: Split git_patchset_body into separate subroutines

This commit makes git_patchset_body easier to read, and reduces level of
nesting and indent level. It adds more lines that it removes because of
extra parameter passing in subroutines, and subroutine calls in
git_patchset_body. Also because there are few added comments.

Below there are descriptions of all split-off subroutines:

Separate formatting "git diff" header into format_git_diff_header_line.
While at it fix it so it always escapes pathname. It would be even more
useful if we decide to use `--cc' for merges, and need to generate by
hand empty patches for anchors.

Separate formatting extended (git) diff header lines into
format_extended_diff_header_line. This one is copied without changes.

Separate formatting two-lines from-file/to-file diff header into
format_diff_from_to_header subroutine. While at it fix it so it always
escapes pathname. Beware calling convention: it takes _two_ lines.

Separate generating %from and %to hashes (with info used among others to
generate hyperlinks) into parse_from_to_diffinfo subroutine. This one is
copied without changes.

Separate checking if file was deleted (and among others therefore does
not have link to the result file) into is_deleted subroutine. This would
allow us to easily change the algotithm to find if file is_deleted in
the result.

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