git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] gitweb: Print commit message without title in commitdiff only if there is any

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 24, 2006, 11:55 UTC
Message-ID
<200610241355.33560.jnareb@gmail.com>
In-Reply-To
<200610241349.54685.jnareb@gmail.com>

Print the rest of commit message (title, i.e. first line of commit message, is printed separately) only if there is any.

In repository which uses signoffs this shouldn't happen, because commit message should consist of at least title and signoff.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a88e0a8..e35ecb4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3360,9 +3360,11 @@ sub git_commitdiff {
 		git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);
 		git_print_authorship(\%co);
 		print "<div class=\"page_body\">\n";
-		print "<div class=\"log\">\n";
-		git_print_log($co{'comment'}, -final_empty_line=> 1, -remove_title => 1);
-		print "</div>\n"; # class="log"
+		if (@{$co{'comment'}} > 1) {
+			print "<div class=\"log\">\n";
+			git_print_log($co{'comment'}, -final_empty_line=> 1, -remove_title => 1);
+			print "</div>\n"; # class="log"
+		}
 
 	} elsif ($format eq 'plain') {
 		my $refs = git_get_references("tags");
-- 
1.4.2.1
Previous: Jakub Narebski
Message 8 of 8 in “gitweb: Improvements to commitdiff oview”
  1. 0/3 gitweb: Improvements to commitdiff oviewJakub Narebski, Oct 24, 2006
  2. 1/3 gitweb: Get rid of git_print_simplified_logJakub Narebski, Oct 24, 2006
  3. 2/3 gitweb: Filter out commit ID from @difftree in git_commit and git_commitdiffJakub Narebski, Oct 24, 2006
  4. Junio C HamanoOct 25, 2006
  5. Jakub NarebskiOct 25, 2006
  6. 4/3 gitweb: Use --no-commit-id in git_commit and git_commitdiffJakub Narebski, Oct 25, 2006
  7. 2/3 gitweb: Use --no-commit-id in git_commit and git_commitdiffJakub Narebski, Oct 25, 2006
  8. 3/3 gitweb: Print commit message without title in commitdiff only if there is anyJakub Narebski, Oct 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.