I'm trying out versioncontrol_git and I'm getting the following error when trying to fetch data from a repository:

Fatal error: require_once() [function.require]: Failed opening required './profiles/openatrium/modules/contrib/ctools/includes/plugins.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /profiles/openatrium/modules/contrib/ctools/ctools.module on line 109

This is due to a chdir() call:

 */
function _versioncontrol_git_log_update_repository(&$repository) {
  $root = escapeshellcmd($repository->root);
  $chdir_ok = @chdir($root); // Set working directory to root.
  if ($chdir_ok === FALSE) {
    return FALSE;
  }

I was able to work around this by setting the include path and removing the './' from the ctools include, but there has to be a better way... :)

Comments

mgriego’s picture

StatusFileSize
new6.93 KB

I ran into this same problem and have coded the attached patch to fix this. It changes the way the git calls work to use the --git-dir option to the git command instead of doing a chdir() to the repository.

mgriego’s picture

Status: Active » Needs review
mgriego’s picture

Status: Needs review » Active
mgriego’s picture

Status: Active » Needs review
StatusFileSize
new6.93 KB

Re-attaching patch with proper status and naming convention.

CorniI’s picture

Hi,
thanks for your work, but unfortunately the log parser of vcs_git has undergone a rewrite in #714228: Cleanup and refactor of versioncontrol_git, where this patch doesn't apply anymore. Could you reroll it against the branch oop-refactored in this repository: http://github.com/CorniI/versioncontrol_git/tree/oop-refactored ?

mgriego’s picture

Yes, I'll see about rerolling that today.

mgriego’s picture

StatusFileSize
new12.85 KB

Here's an updated version of the patch against the oop-refactored branch. This one also includes a small patch to the xgit scripts so that they don't chdir() back into the original working directory until after processing is complete.

mgriego’s picture

Any update on this? I notice that the refactoring is continuing ahead of the coming drupal.org migration...

CorniI’s picture

I have to admit that i totally forgot about this patch, sorry.
But at least committing it requires #714228: Cleanup and refactor of versioncontrol_git to be in, which needs to be reviewed by sdboyer...

marvil07’s picture

Status: Needs review » Needs work
Issue tags: +git phase 2

Most of this was fixed at a sdboyer commit on june, but I still see it at xgit, so changing status accordingly and linking from #484366: Create serverside git hooks to get attention on the work at xgit.

eliza411’s picture

Issue tags: +git sprint 8

Tagging Git Sprint 8

sdboyer’s picture

Assigned: Unassigned » sdboyer
sdboyer’s picture

Assigned: sdboyer » Unassigned

Unassigning from me

marvil07’s picture

Not ready before hard code-freeze, so postponed after launch.

marvil07’s picture

Status: Needs work » Closed (duplicate)

Since the only call to fix here is on #484366: Create serverside git hooks and that issue will change the code there, I am duplicating this one.