Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions models/activities/user_heatmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
return nil, err
}

// HINT: USER-ACTIVITY-PUSH-COMMITS: it only uses the doer's action time, it doesn't use git commit's time
return hdata, db.GetEngine(ctx).
Select(groupBy+" AS timestamp, count(user_id) as contributions").
Table("action").
Expand Down
7 changes: 6 additions & 1 deletion services/feed/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (a *actionNotifier) PushCommits(ctx context.Context, pusher *user_model.Use

opType := activities_model.ActionCommitRepo

// Check it's tag push or branch.
// Check its tag push or branch.
if opts.RefFullName.IsTag() {
opType = activities_model.ActionPushTag
if opts.IsDelRef() {
Expand All @@ -337,6 +337,11 @@ func (a *actionNotifier) PushCommits(ctx context.Context, pusher *user_model.Use
opType = activities_model.ActionDeleteBranch
}

// HINT: USER-ACTIVITY-PUSH-COMMITS: it's said that the time of push commits (for user activity display) is designed this way,
// it doesn't use git commit's time, it only uses the doer's action time.
// ref: https://github.com/go-gitea/gitea/pull/36469#issuecomment-3901955347
// ref: https://github.com/go-gitea/gitea/issues/14051
// ref: https://github.com/go-gitea/gitea/issues/11861#issuecomment-643162143
if err = NotifyWatchers(ctx, &activities_model.Action{
ActUserID: pusher.ID,
ActUser: pusher,
Expand Down
1 change: 1 addition & 0 deletions templates/user/heatmap.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{if .EnableHeatmap}}
{{/*HINT: USER-ACTIVITY-PUSH-COMMITS: it only uses the doer's action time, it doesn't use git commit's time */}}
<div class="activity-heatmap-container">
<div id="user-heatmap" class="is-loading"
data-heatmap-url="{{.HeatmapURL}}"
Expand Down