threads / patch / 61736

patchgitweb: rss/atom change published/updated date to committed date

Subject: [PATCH] gitweb: rss/atom change published/updated date to committed date

## tl;dr

7 messages between Jul 4, 2024 and Jul 8, 2024. Diffs are folded; open one to read it.

replies: 6people: 2as markdown or json

Jesús Ariel Cabello Mateos· Jul 4, 2024, 16:45 UTC · lore

Currently the published(in rss) and the updated(in atom) date used is the authored date. Change it to the committed date that betters reflect the "published/updated" definition and makes rss/atom feeds more lineal. Gitlab/Github rss/atom feeds use the commited date.

The committed date is already used to determine if more items should be fetched.

Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
---
 gitweb/gitweb.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to gitweb/gitweb.perl +1 −1
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ccd14e0e30..0ef5707557 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -8329,7 +8329,7 @@ sub git_feed {
 		if (($i >= 20) && ((time - $co{'author_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
Junio C Hamano· Jul 6, 2024, 06:08 UTC · re: Jesús Ariel Cabello Mateos · lore

Re: [PATCH] gitweb: rss/atom change published/updated date to committed date

Jesús Ariel Cabello Mateos <080ariel@gmail.com> writes:
Show 8 quoted lines
> Currently the published(in rss) and the updated(in atom) date
> used is the authored date. Change it to the committed date 
> that betters reflect the "published/updated" definition and 
> makes rss/atom feeds more lineal. Gitlab/Github rss/atom feeds 
> use the commited date.
>
> The committed date is already used to determine if more items
> should be fetched.

Even though "authored" and "committed" date may be grammatically correct if you use "to author" and "to commit" as verbs, the name we use for these two timestamps are "author date" and "committer date" (in other words, "author" and "committer" are not used as verbs but as nouns for possibly two distinct people). So

 * "committed date" (on the title and elsewhere) and "commited date"
   -> "committer date".
 * "authored date" -> "author date".
 * "lineal" -> "linear"?

But your reasoning is absolutely correct about the concept of "publish" more closely corresponds to the committer date than the author date, and the change looks sensible.

Show 18 quoted lines
> Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
> ---
>  gitweb/gitweb.perl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ccd14e0e30..0ef5707557 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -8329,7 +8329,7 @@ sub git_feed {
>  		if (($i >= 20) && ((time - $co{'author_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,
Ariel Cabello Mateos· Jul 6, 2024, 16:16 UTC · re: Jesús Ariel Cabello Mateos · lore

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

Currently the value used is the author date. 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.

The committer date is already used to determine if more items should be fetched.
Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
---
Changes since v1:
- Typo fix in the commit message.
- Semantic fixes in the commit message.
Thank you, Junio!
 gitweb/gitweb.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to gitweb/gitweb.perl +1 −2
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ccd14e0e30..0ef5707557 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -8329,7 +8329,7 @@ sub git_feed {
                if (($i >= 20) && ((time - $co{'author_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

On Thu, Jul 4, 2024 at 4:46 PM Jesús Ariel Cabello Mateos
<080ariel@gmail.com> wrote:
>
> Currently the published(in rss) and the updated(in atom) date
> used is the authored date. Change it to the committed date
> that betters reflect the "published/updated" definition and
> makes rss/atom feeds more lineal. Gitlab/Github rss/atom feeds
> use the commited date.
>
> The committed date is already used to determine if more items
> should be fetched.
>
> Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
> ---
>  gitweb/gitweb.perl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ccd14e0e30..0ef5707557 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -8329,7 +8329,7 @@ sub git_feed {
>                 if (($i >= 20) && ((time - $co{'author_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
>
Junio C Hamano· Jul 6, 2024, 22:01 UTC · re: Ariel Cabello Mateos · lore

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

Ariel Cabello Mateos <080ariel@gmail.com> writes:
Show 12 quoted lines
> Currently the value used is the author date. 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.
>
> The committer date is already used to determine if more items should be fetched.
>
> Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
> ---
> Changes since v1:
> - Typo fix in the commit message.
> - Semantic fixes in the commit message.
error: corrupt patch at line 20
Show 15 quoted lines
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ccd14e0e30..0ef5707557 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -8329,7 +8329,7 @@ sub git_feed {
>                 if (($i >= 20) && ((time - $co{'author_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,
Junio C Hamano· Jul 6, 2024, 22:35 UTC · re: Junio C Hamano · lore

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

Junio C Hamano <gitster@pobox.com> writes:
> Ariel Cabello Mateos <080ariel@gmail.com> writes:
>
>> Currently the value used is the author date. Change it to the

It is left unsaid what "the value" is used for. Let's rewrite the first sentence like so:

    The author date is used for published/updated date in the
    rss/atom feed stream.  Change it to ...

Another thing that is curious is why the mention of author_epoch is left as is before the hunk.

Shouldn't we use the same committer time for loop cut-off and also for display?

Show changes to gitweb/gitweb.perl +2 −2
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e66eb3d9ba..c1151544cc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -8324,10 +8324,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-899-gfb4fe62777
Jesús Ariel Cabello Mateos· Jul 7, 2024, 18:48 UTC · re: Jesús Ariel Cabello Mateos · lore

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

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(-)
Show changes to gitweb/gitweb.perl +2 −2
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
Junio C Hamano· Jul 8, 2024, 11:11 UTC · re: Jesús Ariel Cabello Mateos · lore

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

Jesús Ariel Cabello Mateos <080ariel@gmail.com> writes:
Show 7 quoted lines
> ...
> 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>
> ---
Nicely done.  Will queue.  Let me mark the topic for 'next'.
Thanks.

← back to recent threads