In #2271365: Move development & issue tracking to github. John Pugh mentions:

If I could make this suggestion, this should be in Aegir core, and should be
refactored to make use of a good symfony-based git php library

If hosting_git makes it into core (which I intend) it's dependencies also drag in provision_git.

Comments

helmo’s picture

This lib might be something to look at: https://github.com/matteosister/GitElephant/

helmo’s picture

Project: Provision Git » Aegir Hosting Git

Moving to hosting git together with: #2364135: 7.x code moved to hosting_git repo

helmo’s picture

A suggestion from Jon Pugh in https://www.drupal.org/node/2355157

We should really consider using @cpliakas's git wrapper package:

https://github.com/cpliakas/git-wrapper

clemens.tolboom’s picture

The usage statistics on packegist.org suggest something different comparing

https://packagist.org/packages/matteosister/GitElephant
https://packagist.org/packages/cpliakas/git-wrapper
https://packagist.org/packages/sebastian/git

Checking for feature set git-wrapper and GitElephant outrun sebastian/git

Based on usage next https://packagist.org/packages/cpliakas/git-wrapper is the better choice.

But I would vote if possible for a git module/drush extension instead of adding this to 'Hosting Git'

helmo’s picture

git-wrapper looks nice ...

I did a little experiment while working on #2283145: Update git url and branch on verify
Here's some mock code...

   // Initialize the library. If the path to the Git binary is not passed as
  // // the first argument when instantiating GitWrapper, it is auto-discovered.
  use GitWrapper\GitWrapper;
  require_once 'vendor/autoload.php';
  $wrapper = new GitWrapper();

  $git = $wrapper->workingCopy($repo_path);
  $gitbr = $git->getBranches();
  $node->git['repo_url'] = $git->config('--local', '--get', 'remote.origin.url');
  $node->git['git_ref'] = $gitbr->head();
helmo’s picture

Title: Refactor » Refactor to use a Git library
ergonlogic’s picture

https://packagist.org/packages/cpliakas/git-wrapper looks like the best choice to me.