Defect #15306
closedNo database update on git history rewrite
0%
Description
Versions¶
- redmine 2.3.3.stable
- ruby 2.0.0
- Rails 3.2.13
Bug summary:¶
I refer to issues as much as I can in my commit messages.
While migrating a repository from another ticket tracking
system into redmine, I linked redmine with an existing
repository. Then, obviously the tickets in redmine were
not in sync with the tickets referenced in the commits.
So I rewrote git history by doing a huge
git rebase -i HEAD~42
to change the referenced tickets into the new ones. And
then I did a
git push -f
to overwrite the repository's history. But then, I've been surprised to see no updates in the
tickets. e.g.:
- ticket 1 should have become ticket
#42
and - new ticket
#1
should have had been referenced by no commits...
But after my change ticket#1
was still having references
from commits.
I tried removing and re-adding the repository, but that
had no effects.
I finally found out that even after removing the repository,
the changesets table in the database was still having all
commits for the repository.
- Q&D solution:
To solve my problem I ended up issuing a:
delete from repositories where id=3; delete from changesets where repository_id=3;
which finally removed the old commits from references of
the tickets. Though, now I'm afraid to have n-n tables
still having orphans.
Here is for the overall context of the bug, I did not
dig further, as I'm not having a development instance
of redmine and I need my production instance to work
correctly. I neither checked whether that bug was still
there at HEAD of redmine, and finally I'm not sure this
is not a duplicate, though I've searched around the
issues and found nothing.
- Reproduce
But I think that bug is definitely reproduceable:
- make a new redmine instance
- create a ticket
#N
- make a commit referring to that ticket (e.g.
git ci -m "fixes #N"
) git push
the commit to the repository redmine is reading from- reload the ticket, the commit is now visible
- rewrite the history:
git rebase -i HEAD~42
or simplygit commit --amend -m "fixes #M"
git push -f
that commit to rewrite repository's history as well- reload the ticket, the commit is still visible whereas it shall not be visible anymore
HTH,
Guyzmo
Related issues
Updated by Toshi MARUYAMA about 11 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Duplicate with #12853.
Updated by Toshi MARUYAMA about 11 years ago
- Is duplicate of Feature #12853: Removing git branch result of database inconsistencies added