Closed kirkmadera closed 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;
}
+
/**
*/
public function getVersion()
{
if (is_null($this->version)) {
// unix only!
$this->version = exec('git --version | cut -d " " -f 3');
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.
This is useful for gracefully supporting newer git binary functions. For example the
--branch
option of thegit clone
command is only available from 2.0.0 and up.