Project

General

Profile

Actions

Defect #9897

open

Git: revisions and branches deleted in Git repository are shown in redmine

Added by Alexei Kornienko over 12 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When using Git repository for the project I've noticed that revisions and branches that were deleted from the repository itself are still shown in Redmine repository browser.
Most likely the problem is in Redmine revision cache cause once fetched revisions remain there even after they were deleted in repository.

Steps to reproduce:
1) create branch in Git, make several commits
2) push branch to bare repository that is connected to Redmine
3) make sure that branch is shown in repo browser in Redmine
4) delete branch from bare repository
5) branch is still shown in Redmine :(

Actions #1

Updated by Slawomir CALUCH over 12 years ago

This problem was affecting previous versions as fas as I remember.

The only way to fix the content of the redmine repo is to delete the repository and re-add it.

This defect seems to be clearly related to feature #1273.

Actions #2

Updated by Pierre-Luc Samuel about 12 years ago

I don't know if redmine uses git fetch, but a git fetch cmd would use "--prune" to remove branches that were deleted in the repository. Of course, if redmine keeps a cache of the repo, that won't clean it's internal cache...

Actions #3

Updated by Rafael Ascensao almost 12 years ago

Also have this problem. Had do delete and re-add to fix.

Actions #4

Updated by Jesús García Crespo about 11 years ago

Try to run the following git command from the git bare repository:

git remote prune origin

That should do the trick. If so, we could add a note in the docs.

Actions #5

Updated by Alexei Kornienko about 11 years ago

No.. this won't help.
Problem is that redmine caches revisions for later use.
So a revision may be deleted in git but it is still cached in redmine.
From my point of view the right solution would be to read git refs to find existing branches and only show commits that are in branch history (the same way as git builds repository history).

Basically right now git repository must be setup on the same server with redmine. It means that in 90% of the cases we don't need redmine revision cache at all since reading from Git directly should be fast enough (caching is needed for remote SVN repository for example).
So another solution would be to disable revision cache for git

Actions #6

Updated by Dietmar H over 9 years ago

Pierre-Luc Samuel wrote:

I don't know if redmine uses git fetch, but a git fetch cmd would use "--prune" to remove branches that were deleted in the repository. Of course, if redmine keeps a cache of the repo, that won't clean it's internal cache...

I just had the same issue, for me adding --prune to the fetch command solved it (Redmine 2.4.1).

Actions

Also available in: Atom PDF