Deleted commits are visible and accessible, if they are referenced in an issue #339

Open
opened 6 months ago by ncc1988 · 11 comments
ncc1988 commented 6 months ago

I pushed commits that had to be deleted using git reset --hard and a forced push to the remote. They aren't in the repository anymore, but still visible in the issue where they are referenced. The issue in question is this one:

ncc1988/moeripper#2

To confirm the commits are gone, I checked out the repository in another directory. When trying to checkout the last commit-IDs from the issue in the repository, git tells me that the reference is not a tree, so they are definetly deleted. The deleted commits also aren't visible in the project's commit history.

I pushed commits that had to be deleted using git reset --hard and a forced push to the remote. They aren't in the repository anymore, but still visible in the issue where they are referenced. The issue in question is this one: https://codeberg.org/ncc1988/moeripper/issues/2 To confirm the commits are gone, I checked out the repository in another directory. When trying to checkout the last commit-IDs from the issue in the repository, git tells me that the reference is not a tree, so they are definetly deleted. The deleted commits also aren't visible in the project's commit history.
hw added the
bug
gitea-related
labels 6 months ago
hw commented 6 months ago
Owner

That seems serious. Can you please create an upstream issue in https://github.com/go-gitea/gitea ?

That seems serious. Can you please create an upstream issue in https://github.com/go-gitea/gitea ?
Poster

I am not on GitHub, sorry.

I am not on GitHub, sorry.
hw commented 6 months ago
Owner

ok, will do.

ok, will do.
hw commented 6 months ago
Owner
https://github.com/go-gitea/gitea/issues/13674
Poster

Thank you :-)

Thank you :-)
Collaborator

It's not directly a bug, as long as this commits are not deleted in the repo they will be displayed. So an enhancement would be if gitea detects a forcepush to recheck all commits and manually mark CommitComments no longer atattched to a pull as deleted via altering the DB entry.

It's not directly a bug, as long as this commits are not deleted in the repo they will be displayed. So an enhancement would be if gitea detects a forcepush to recheck all commits and manually mark CommitComments no longer atattched to a pull as deleted via altering the DB entry.
hw commented 5 months ago
Owner

this sounds very valuable

this sounds very valuable
Collaborator
https://github.com/go-gitea/gitea/issues/13694
fnetX added the
upstream
label 2 months ago
Collaborator

By the way, are the commits ever deleted from the server? It looks like there's no cleanup and the repo size is constantly growing. Can be observed via Codeberg/gitea and docs/pages where the size seems to steadily grow with every force push. And even commits that have been force-pushed 6 months ago are still not gone, so it doesn't look like git does garbage collect them?
Is git gc supposed to clean this up and working?

By the way, are the commits ever deleted from the server? It looks like there's no cleanup and the repo size is constantly growing. Can be observed via Codeberg/gitea and docs/pages where the size seems to steadily grow with every force push. And even commits that have been force-pushed 6 months ago are still not gone, so it doesn't look like git does garbage collect them? Is git gc supposed to clean this up and working?

Isnt it normal, that if something (issue, pull/merge request, comment) references a commit, that that branch of the tree will not be deleted by garbage collection?

Isnt it normal, that if something (issue, pull/merge request, comment) references a commit, that that branch of the tree will not be deleted by garbage collection?
Collaborator

Well that sounds like complicated tracking as the docs/pages only shows the old commits in the dashboard of this organization AFAICT. So there must be a check that this is shown in such a history as well. But might be possible.

I still think that this behaviour is not completely desirable: It creates a lot of junk on the server storage for stuff that is frequently force-pushed and it makes it impossible to undo accident commits. I think there should be a way for repo owners or admins to delete this somewhere ...

Well that sounds like complicated tracking as the docs/pages only shows the old commits in the dashboard of this organization AFAICT. So there must be a check that this is shown in such a history as well. But might be possible. I still think that this behaviour is not completely desirable: It creates a lot of junk on the server storage for stuff that is frequently force-pushed and it makes it impossible to undo accident commits. I think there should be a way for repo owners or admins to delete this somewhere ...
Sign in to join this conversation.
Loading…
There is no content yet.