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

[PATCH 3/3] gitweb: Use author_epoch for pubdate in gitweb feeds

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 25, 2006, 14:54 UTC
Message-ID
<11644665273247-git-send-email-jnareb@gmail.com>
In-Reply-To
<11644664743455-git-send-email-jnareb@gmail.com>

Use creation date (author_epoch) instead of former commit date (committer_epoch) as publish date in gitweb feeds (RSS, Atom).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This I'm not so sure about. I just wonder why commit date was used
as publish date of feed item/entry...
 gitweb/gitweb.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 15dd1f4..fac7923 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4201,7 +4201,7 @@ sub git_feed {
 	}
 	if (defined($revlist[0])) {
 		%latest_commit = parse_commit($revlist[0]);
-		%latest_date   = parse_date($latest_commit{'committer_epoch'});
+		%latest_date   = parse_date($latest_commit{'author_epoch'});
 		print $cgi->header(
 			-type => $content_type,
 			-charset => 'utf-8',
@@ -4294,10 +4294,10 @@ XML
 		my $commit = $revlist[$i];
 		my %co = parse_commit($commit);
 		# we read 150, we always show 30 and the ones more recent than 48 hours
-		if (($i >= 20) && ((time - $co{'committer_epoch'}) > 48*60*60)) {
+		if (($i >= 20) && ((time - $co{'author_epoch'}) > 48*60*60)) {
 			last;
 		}
-		my %cd = parse_date($co{'committer_epoch'});
+		my %cd = parse_date($co{'author_epoch'});
 
 		# get list of changed files
 		open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
-- 
1.4.4.1
Previous: Jakub Narebski
Message 3 of 3 in “gitweb: Add author and committer email extraction to parse_commit”
  1. 1/3 gitweb: Add author and committer email extraction to parse_commitJakub Narebski, Nov 25, 2006
  2. 2/3 gitweb: Add author and contributor email to Atom feedJakub Narebski, Nov 25, 2006
  3. 3/3 gitweb: Use author_epoch for pubdate in gitweb feedsJakub Narebski, Nov 25, 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.