ericpaulbishop / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
186 stars 37 forks source link

/sub-sub-sub-project gets renamed to /project somehow #122

Open Jehreg opened 13 years ago

Jehreg commented 13 years ago

The admin goes to check the Project settings and saves the page. One second later the following appears in the auth.log:

Nov 16 08:42:28 redmine sshd[12348]: Accepted publickey for git from 198.103.103.169 port 55905 ssh2
Nov 16 08:42:28 redmine sshd[12348]: pam_unix(sshd:session): session opened for user git by (uid=0)
Nov 16 08:42:29 redmine sshd[12359]: Received disconnect from 198.103.103.169: 11: disconnected by user
Nov 16 08:42:29 redmine sshd[12348]: pam_unix(sshd:session): session closed for user git
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval test -r ~/.gitolite/hooks/common/post-receive
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval bash
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval cat ~/.gitolite/hooks/common/post-receive
Nov 16 08:42:29 redmine sshd[12387]: Accepted publickey for git from 198.103.103.169 port 55907 ssh2
Nov 16 08:42:29 redmine sshd[12387]: pam_unix(sshd:session): session opened for user git by (uid=0)
Nov 16 08:42:29 redmine sshd[12398]: Received disconnect from 198.103.103.169: 11: disconnected by user
Nov 16 08:42:29 redmine sshd[12387]: pam_unix(sshd:session): session closed for user git
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval mkdir -p "repositories/gcwwwdrupal-git.git"
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval rmdir "repositories/gcwwwdrupal-git.git"
Nov 16 08:42:29 redmine sudo:    chili : TTY=unknown ; PWD=/var/www/rails_apps/chili ; USER=git ; COMMAND=/bin/bash -c eval mv "repositories/gcwwwtemplates/gcwwwvar/gcwwwdrupal/gcwwwdrupal-git.git" "repositories/gcwwwdrupal-git.git"

So, somehow, the function update_git_repo_for_new_parent in ./lib/git_hosting/patches/projects_controller_patch.rb gets called even when the project parent doesn't get changed.

This is plugin commit 1101f5d and Chili commit b43bf18

Anyone else seen this ? Anyone else using sub-projects that are at least 2 deep ?

kubitron commented 13 years ago

Which version of Redmine are you using? I am wondering if the "subproject of" selector is blank on the settings page (because of a bug in Redmine)? This would explain that behavior. I just tried this, incidentally, and it seems to work fine with version 1.2.2 of Redmine...

Note that update_git_repo_for_new_parent is set up as a ":before_filter", so gets called on every project update (regardless of whether or not the parent changes); the internals of the routine decides whether or not a change actually happened....

Jehreg commented 12 years ago

ChiliProject, commit id b43bf18

kubitron commented 12 years ago

Do you know which version this corresponds to? (I am more familiar with the svn numbers from the redmine site)?

At any rate, more important is my other question: is the "subproject of" selector blank on the settings page? (rather than pointing to the parent project)?

kubitron commented 12 years ago

Please try my master branch. It has a bunch of fixes to make movement of parents for repositories much more stable. Please give it a try:

https://github.com/ericpaulbishop/redmine_git_hosting