matteosister / GitElephant

An abstraction layer for git written in PHP
GNU Lesser General Public License v3.0
613 stars 74 forks source link

Added ability to get git binary version from within commands #147

Closed kirkmadera closed 6 years ago

kirkmadera commented 6 years ago

This is useful for gracefully supporting newer git binary functions. For example the --branch option of the git clone command is only available from 2.0.0 and up.

kirkmadera commented 6 years ago

Makes sense. I’ll update that.

From: Bernhard Webstudio notifications@github.com Sent: Friday, August 31, 2018 1:55 AM To: matteosister/GitElephant GitElephant@noreply.github.com Cc: Kirk Madera kmadera@robofirm.com; Author author@noreply.github.com Subject: Re: [matteosister/GitElephant] Added ability to get git binary version from within commands (#147)

@BernhardWebstudio commented on this pull request.

Thanks for your work! Just wondering whether it is easy to get it working cross-platform with end(explode(" ", $output)) înstead of using the cut command?


In src/GitElephant/GitBinary.phphttps://github.com/matteosister/GitElephant/pull/147#discussion_r214249735:

@@ -68,4 +73,18 @@ public function setPath(string $path)

 {

     $this->path = $path;

 }

+

Is this Unix-only because the cut command is - depending on the configuration - only available in Git Bash? Is so, could we make it cross-platform with e.g. end(explode(" ". $output))?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/matteosister/GitElephant/pull/147#pullrequestreview-151265363, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABm735O05WGoyXuE408NxnZLGSG1_-bdks5uWM_MgaJpZM4WUOE8.