Dashboard showing duplicate commits #3197

Closed
opened 2025-11-02 05:03:31 -06:00 by GiteaMirror · 22 comments
Owner

Originally created by @theAkito on GitHub (Apr 15, 2019).

  • Gitea version (or commit ref): b04a1d9d6
  • Git version: 2.11.0
  • Operating system: DietPi, based on Raspbian GNU/Linux 9 (stretch)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Commits shown are duplicated on the dashboard (not actually duplicated, it just looks like it) in the following way:

  1. Start editing a file within your repository on Gitea.
  2. E.g. add another file to the repository and commit the change.
  3. E.g. edit another file on this repository and commit the change.
  4. Finish editing the very first file and commit the change.

If you do something like that, then the third commit will include all these previous commits that happened during the edition of the first file, on the dashboard.

Screenshots

2019-04-15 17_17_47-Gitea-bug_A

Originally created by @theAkito on GitHub (Apr 15, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): b04a1d9d6 - Git version: 2.11.0 - Operating system: DietPi, based on Raspbian GNU/Linux 9 (stretch) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Commits shown are duplicated on the dashboard (not actually duplicated, it just looks like it) in the following way: 1. Start editing a file within your repository on Gitea. 2. E.g. add another file to the repository and commit the change. 3. E.g. edit another file on this repository and commit the change. 4. Finish editing the very first file and commit the change. If you do something like that, then the third commit will include all these previous commits that happened during the edition of the first file, on the dashboard. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![2019-04-15 17_17_47-Gitea-bug_A](https://user-images.githubusercontent.com/26848976/56144373-8c9dc000-5fa2-11e9-9964-fb1a4101ee3b.png)
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 05:03:31 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jun 14, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jun 14, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@andreymal commented on GitHub (Jun 14, 2019):

@‍stale nope

@andreymal commented on GitHub (Jun 14, 2019): **@‍stale** nope
Author
Owner

@stale[bot] commented on GitHub (Aug 15, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 15, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@andreymal commented on GitHub (Aug 15, 2019):

@‍stale still nope

@andreymal commented on GitHub (Aug 15, 2019): **@‍stale** still nope
Author
Owner

@lunny commented on GitHub (Aug 15, 2019):

@andreymal @Akito13 could you test v1.9.1 fixed that? There is a bug duplicated webhooks fixed on v1.9.1 maybe it's related.

@lunny commented on GitHub (Aug 15, 2019): @andreymal @Akito13 could you test v1.9.1 fixed that? There is a bug duplicated webhooks fixed on v1.9.1 maybe it's related.
Author
Owner

@andreymal commented on GitHub (Sep 23, 2019):

@lunny still present in v1.9.1 (didn't test v1.9.3 yet)

@andreymal commented on GitHub (Sep 23, 2019): @lunny still present in v1.9.1 (didn't test v1.9.3 yet) ![](https://i.imgur.com/EmcU6PC.png)
Author
Owner

@lafriks commented on GitHub (Sep 23, 2019):

@andreymal old ones that was already duplicated won't go away. It should not happen anymore for new commits with latest version

@lafriks commented on GitHub (Sep 23, 2019): @andreymal old ones that was already duplicated won't go away. It should not happen anymore for new commits with latest version
Author
Owner

@andreymal commented on GitHub (Sep 23, 2019):

@lafriks this is not old, this happened 6 days ago with gitea v1.9.1

@andreymal commented on GitHub (Sep 23, 2019): @lafriks this is not old, this happened 6 days ago with gitea v1.9.1
Author
Owner

@andreymal commented on GitHub (Sep 23, 2019):

@lafriks tried v1.9.3 right now — still happens

@andreymal commented on GitHub (Sep 23, 2019): @lafriks tried v1.9.3 right now — still happens ![](https://i.imgur.com/2SKVCbT.png)
Author
Owner

@guillep2k commented on GitHub (Sep 23, 2019):

@lafriks Could this problem be related to this? (follow the comment)

@guillep2k commented on GitHub (Sep 23, 2019): @lafriks Could this problem be related to [this](https://github.com/go-gitea/gitea/issues/7843#issuecomment-533966958)? (follow the comment)
Author
Owner

@lafriks commented on GitHub (Sep 23, 2019):

Could be, hard to tell

@lafriks commented on GitHub (Sep 23, 2019): Could be, hard to tell
Author
Owner

@lunny commented on GitHub (Sep 30, 2019):

Have you tried to Resynchronize pre-receive, update and post-receive hooks of all repositories. on your admin panel.

@lunny commented on GitHub (Sep 30, 2019): Have you tried to `Resynchronize pre-receive, update and post-receive hooks of all repositories.` on your admin panel.
Author
Owner

@theAkito commented on GitHub (Nov 21, 2019):

Update 2019|22|21

Since a couple dozen commits to Gitea this issue happens all the time when commiting from the WebUI. No matter the conditions. It does not matter anymore, if other files are already open or not.

@theAkito commented on GitHub (Nov 21, 2019): ## Update 2019|22|21 Since a couple dozen commits to Gitea this issue happens all the time when commiting from the WebUI. No matter the conditions. It does not matter anymore, if other files are already open or not.
Author
Owner

@zeripath commented on GitHub (Nov 21, 2019):

What version of Gitea? Could you try on 1.10?

Just double check that you haven't got two Gitea hooks in your Gitea repositories?

@zeripath commented on GitHub (Nov 21, 2019): What version of Gitea? Could you try on 1.10? Just double check that you haven't got two Gitea hooks in your Gitea repositories?
Author
Owner

@theAkito commented on GitHub (Nov 21, 2019):

@zeripath

Since a couple dozen commits to Gitea

As in I used a couple of the most recent versions of Gitea from the past weeks.

I also did not set up any Hooks manually. Even so, I still checked and I don't see any duplicate hooks.

@theAkito commented on GitHub (Nov 21, 2019): @zeripath > Since a couple dozen commits to Gitea As in I used a couple of the most recent versions of Gitea from the past weeks. I also did not set up any Hooks manually. Even so, I still checked and I don't see any duplicate hooks.
Author
Owner

@guillep2k commented on GitHub (Nov 22, 2019):

@zeripath check my comment here. I think this may be the cause.

@guillep2k commented on GitHub (Nov 22, 2019): @zeripath check [my comment here](https://github.com/go-gitea/gitea/issues/7843#issuecomment-533966958). I think this may be the cause.
Author
Owner

@4oo4 commented on GitHub (Feb 23, 2020):

I'm still having this with v1.11.1, I just noticed that somehow I have duplicate hooks scripts on my Gitea server.

/home/git/gitea-repositories/user/my-repo.git/hooks $ ls post-receive.d
gitea  post-receive

/home/git/gitea-repositories/user/my-repo.git/hooks > $ cat post-receive.d/*
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' post-receive
#!/usr/bin/env bash
"/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' post-receive

Not sure how that happened but I'm guessing that removing one of those in all of my repos will fix it. I think I had to do this before when migrating from Gogs, not sure when these hooks got duplicated.

@4oo4 commented on GitHub (Feb 23, 2020): I'm still having this with v1.11.1, I just noticed that somehow I have duplicate hooks scripts on my Gitea server. ```bash /home/git/gitea-repositories/user/my-repo.git/hooks $ ls post-receive.d gitea post-receive /home/git/gitea-repositories/user/my-repo.git/hooks > $ cat post-receive.d/* #!/usr/bin/env bash "/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' post-receive #!/usr/bin/env bash "/home/git/gitea/gitea" hook --config='/home/git/gitea/custom/conf/app.ini' post-receive ``` Not sure how that happened but I'm guessing that removing one of those in all of my repos will fix it. I think I had to do this before when migrating from Gogs, not sure when these hooks got duplicated.
Author
Owner

@theAkito commented on GitHub (Feb 23, 2020):

@4oo4 Post your results, when you are done applying the possible fix.

@theAkito commented on GitHub (Feb 23, 2020): @4oo4 Post your results, when you are done applying the possible fix.
Author
Owner

@guillep2k commented on GitHub (Feb 24, 2020):

The good ones are those named gitea. You should have:

$ find hooks ! -name '*.sample' -type f
hooks/pre-receive.d/gitea     // Gitea's pre-receive hook
hooks/pre-receive             // Cycles through hooks inside hooks/pre-receive.d/
hooks/update.d/gitea          // Gitea's update hook
hooks/update                  // Cycles through hooks inside hooks/update.d/
hooks/post-receive.d/gitea    // Gitea's post-receive hook
hooks/post-receive            // Cycles through hooks inside hooks/post-receive.d/

(You can ignore the .sample hooks, which have no effect).

Please be aware that there could also be some other hooks placed by repository owners as long as you enabled them.

@guillep2k commented on GitHub (Feb 24, 2020): The good ones are those named `gitea`. You should have: ``` $ find hooks ! -name '*.sample' -type f hooks/pre-receive.d/gitea // Gitea's pre-receive hook hooks/pre-receive // Cycles through hooks inside hooks/pre-receive.d/ hooks/update.d/gitea // Gitea's update hook hooks/update // Cycles through hooks inside hooks/update.d/ hooks/post-receive.d/gitea // Gitea's post-receive hook hooks/post-receive // Cycles through hooks inside hooks/post-receive.d/ ``` (You can ignore the `.sample` hooks, which have no effect). Please be aware that there could also be some other hooks placed by repository owners as long as you enabled them.
Author
Owner

@4oo4 commented on GitHub (Feb 24, 2020):

@theAkito That fixed it for me. Basically in my hooks/pre-receive.d and hooks/post-receive.d folders in each repo, there was a duplicate post-recieve or pre-receive hook, and like @guillep2k says I kept the ones named gitea as the good ones.

To fix them en masse, first cd to your folder where you store your gitea repositories. Then this one liner will find those duplicates and get rid of them while keeping the good ones. not sure what that would do for custom user hooks though, could those possibly be named either pre-receive or post-receive?

find . -regextype egrep -regex ".*/*.git/hooks/(pre|post)-receive.d/(pre|post)-receive" -exec sudo rm {} \;

Obviously you want to back up your repositories directory before running that. Then, when I committed to a repo that had the duplicate hooks, it only displayed once in the dashboard. I didn't realize it until now but for a while the duplicate ones were also giving me duplicate messages in the terminal when I ran git push to sync my repos. That's fixed now too.

@4oo4 commented on GitHub (Feb 24, 2020): @theAkito That fixed it for me. Basically in my `hooks/pre-receive.d` and `hooks/post-receive.d` folders in each repo, there was a duplicate `post-recieve` or `pre-receive` hook, and like @guillep2k says I kept the ones named `gitea` as the good ones. To fix them en masse, first `cd` to your folder where you store your gitea repositories. Then this one liner will find those duplicates and get rid of them while keeping the good ones. not sure what that would do for custom user hooks though, could those possibly be named either `pre-receive` or `post-receive`? `find . -regextype egrep -regex ".*/*.git/hooks/(pre|post)-receive.d/(pre|post)-receive" -exec sudo rm {} \;` Obviously you want to back up your repositories directory before running that. Then, when I committed to a repo that had the duplicate hooks, it only displayed once in the dashboard. I didn't realize it until now but for a while the duplicate ones were also giving me duplicate messages in the terminal when I ran `git push` to sync my repos. That's fixed now too.
Author
Owner

@theAkito commented on GitHub (Feb 24, 2020):

Seems like this is related to this. Perbe being the root cause of this.

@theAkito commented on GitHub (Feb 24, 2020): Seems like this is related to [this](https://github.com/go-gitea/gitea/issues/9183). Perbe being the root cause of this.
Author
Owner

@theAkito commented on GitHub (Feb 24, 2020):

@4oo4

I fixed it like this, though your way of handling the issue probably applies to a greater audience.

Since this fixed it for us, I consider this issue closed.

@theAkito commented on GitHub (Feb 24, 2020): @4oo4 I fixed it like [this](https://github.com/go-gitea/gitea/issues/9183#issuecomment-590247528), though your way of handling the issue probably applies to a greater audience. Since this fixed it for us, I consider this issue closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3197