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

[PATCH v3] gitweb: rss/atom change published/updated date to committer date

From
Jesús Ariel Cabello Mateos <080ariel@gmail.com>
Date
Jul 7, 2024, 18:48 UTC
Message-ID
<20240707184813.33166-1-080ariel@gmail.com>
In-Reply-To
<20240704164547.94341-1-080ariel@gmail.com>

The author date is used for published/updated date in the rss/atom feed stream. Change it to the committer date that betters reflect the "published/updated" definition and makes rss/atom feeds more linear. Gitlab/Github rss/atom feeds use the committer date.

Additionally, to be consistent, also use the committer date to determine the date of the last commit to send in the feed instead of the author date.

Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
---
Changes since v2:
- Fix line wrapping in patch
- Also use authored date for processing loop.
- Rewrite commit message for clarity.
Thank you, Junio!
 gitweb/gitweb.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ccd14e0e30..b09a8d0523 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -8326,10 +8326,10 @@ sub git_feed {
 		my %co = %{$commitlist[$i]};
 		my $commit = $co{'id'};
 		# we read 150, we always show 30 and the ones more recent than 48 hours
-		if (($i >= 20) && ((time - $co{'author_epoch'}) > 48*60*60)) {
+		if (($i >= 20) && ((time - $co{'committer_epoch'}) > 48*60*60)) {
 			last;
 		}
-		my %cd = parse_date($co{'author_epoch'}, $co{'author_tz'});
+		my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});
 
 		# get list of changed files
 		open my $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
-- 
2.45.2
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “gitweb: rss/atom change published/updated date to committed date”
  1. gitweb: rss/atom change published/updated date to committed dateJesús Ariel Cabello Mateos, Jul 4, 2024
  2. Junio C HamanoJul 6, 2024
  3. gitweb: rss/atom change published/updated date to committer dateAriel Cabello Mateos, Jul 6, 2024
  4. Junio C HamanoJul 6, 2024
  5. Junio C HamanoJul 6, 2024
  6. gitweb: rss/atom change published/updated date to committer dateJesús Ariel Cabello Mateos, Jul 7, 2024
  7. Junio C HamanoJul 8, 2024

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.