git gc cron should not change repo's updated_unix timestamp #7256

Closed
opened 2025-11-02 07:21:01 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @silverwind on GitHub (Apr 27, 2021).

Since https://github.com/go-gitea/gitea/pull/15177, a repo's updated_unix timestamp seen on a repo on a org page can change when the git gc cron runs which I think is undesirable because it makes it seem as thought someone pushed to the repo while actually nothing happend. It executes with this SQL:

models/repo.go:744:updateSize() [I] [SQL] SELECT COALESCE(sum(`size`),0) FROM `lfs_meta_object` WHERE (repository_id = ?) [260] - 750.016µs
.../repository/check.go:96:func1() [I] [SQL] UPDATE `repository` SET `size` = ?, `updated_unix` = ? WHERE `id`=? [41395 1619453525 260] - 2.02599ms

I think updated_unix should not be updated during the git gc cron and instead only update when actual changes happen in the repo files, e.g. push actions.

Originally created by @silverwind on GitHub (Apr 27, 2021). Since https://github.com/go-gitea/gitea/pull/15177, a repo's `updated_unix` timestamp seen on a repo on a org page can change when the `git gc` cron runs which I think is undesirable because it makes it seem as thought someone pushed to the repo while actually nothing happend. It executes with this SQL: ``` models/repo.go:744:updateSize() [I] [SQL] SELECT COALESCE(sum(`size`),0) FROM `lfs_meta_object` WHERE (repository_id = ?) [260] - 750.016µs .../repository/check.go:96:func1() [I] [SQL] UPDATE `repository` SET `size` = ?, `updated_unix` = ? WHERE `id`=? [41395 1619453525 260] - 2.02599ms ``` I think `updated_unix` should not be updated during the `git gc` cron and instead only update when actual changes happen in the repo files, e.g. push actions.
GiteaMirror added the type/bug label 2025-11-02 07:21:01 -06:00
Author
Owner

@lunny commented on GitHub (Apr 27, 2021):

I think v1.14 should also have the problem.

@lunny commented on GitHub (Apr 27, 2021): I think v1.14 should also have the problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7256