Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard showing duplicate commits #6636

Closed
2 of 7 tasks
theAkito opened this issue Apr 15, 2019 · 22 comments
Closed
2 of 7 tasks

Dashboard showing duplicate commits #6636

theAkito opened this issue Apr 15, 2019 · 22 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@theAkito
Copy link

theAkito commented Apr 15, 2019

  • Gitea version (or commit ref): b04a1d9
  • 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

@stale
Copy link

stale bot commented 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 stale bot added the issue/stale label Jun 14, 2019
@andreymal
Copy link

@‍stale nope

@stale stale bot removed the issue/stale label Jun 14, 2019
@lunny lunny added the type/bug label Jun 15, 2019
@stale
Copy link

stale bot commented 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 stale bot added the issue/stale label Aug 15, 2019
@andreymal
Copy link

@‍stale still nope

@stale stale bot removed the issue/stale label Aug 15, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Aug 15, 2019
@lunny
Copy link
Member

lunny commented 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.

@andreymal
Copy link

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

@lafriks
Copy link
Member

lafriks commented 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

@andreymal
Copy link

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

@andreymal
Copy link

@lafriks tried v1.9.3 right now — still happens

@guillep2k
Copy link
Member

guillep2k commented Sep 23, 2019

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

@lafriks
Copy link
Member

lafriks commented Sep 23, 2019

Could be, hard to tell

@lunny
Copy link
Member

lunny commented Sep 30, 2019

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

@theAkito
Copy link
Author

theAkito commented 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.

@zeripath
Copy link
Contributor

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?

@theAkito
Copy link
Author

@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.

@guillep2k
Copy link
Member

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

@4oo4
Copy link

4oo4 commented 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.

@theAkito
Copy link
Author

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

@guillep2k
Copy link
Member

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.

@4oo4
Copy link

4oo4 commented 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.

@theAkito
Copy link
Author

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

@theAkito
Copy link
Author

@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.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

No branches or pull requests

7 participants