public static function create(Repository $repository, $commit1 = null, $commit2 = null, string $path = null)
    {
        $commit = new self($repository);
        $commit->createFromCommand($commit1, $commit2, $path);

        return $commit;
    }
public static function create(Repository $repository, $commit1 = null, $commit2 = null, string $path = null)
    {
        $commit = new self($repository);
        $commit->createFromCommand($commit1, $commit2, $path);

        return $commit;
    }
public static function create ( Repository $ repository , $ commit1 = null , $ commit2 = null , string $ path = null ) { $ commit = new self ( $ repository ) ; $ commit -> createFromCommand ( $ commit1 , $ commit2 , $ path ) ; return $ commit ; }
static generator to generate a Diff object

@param \GitElephant\Repository                 $repository repository
@param null|string|\GitElephant\Objects\Commit $commit1    first commit
@param null|string|\GitElephant\Objects\Commit $commit2    second commit
@param null|string                             $path       path to consider

@throws \RuntimeException
@throws \InvalidArgumentException
@throws \Symfony\Component\Process\Exception\RuntimeException
@return Diff
static generator to generate a Diff object