Skip to content

Commit 94cddcf

Browse files
committed
Merge pull request kbjr#29 from thelfensdrfer/master
Added git log command
2 parents b3cf49b + 57093f7 commit 94cddcf

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

Git.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function set_bin($path) {
4848
public static function get_bin() {
4949
return self::$bin;
5050
}
51-
51+
5252
/**
5353
* Sets up library for use in a default Windows environment
5454
*/
@@ -82,13 +82,13 @@ public static function &create($repo_path, $source = null) {
8282
public static function open($repo_path) {
8383
return new GitRepo($repo_path);
8484
}
85-
85+
8686
/**
8787
* Clones a remote repo into a directory and then returns a GitRepo object
8888
* for the newly created local repo
89-
*
89+
*
9090
* Accepts a creation path and a remote to clone from
91-
*
91+
*
9292
* @access public
9393
* @param string repository path
9494
* @param string remote source
@@ -318,7 +318,7 @@ public function run($command) {
318318
* Runs a 'git status' call
319319
*
320320
* Accept a convert to HTML bool
321-
*
321+
*
322322
* @access public
323323
* @param bool return string with <br />
324324
* @return string
@@ -346,7 +346,7 @@ public function add($files = "*") {
346346
}
347347
return $this->run("add $files -v");
348348
}
349-
349+
350350
/**
351351
* Runs a `git rm` call
352352
*
@@ -621,6 +621,19 @@ public function pull($remote, $branch) {
621621
return $this->run("pull $remote $branch");
622622
}
623623

624+
/**
625+
* List log entries.
626+
*
627+
* @param strgin $format
628+
* @return string
629+
*/
630+
public function log($format = null) {
631+
if ($format === null)
632+
return $this->run('log');
633+
else
634+
return $this->run('log --pretty=format:"' . $format . '"');
635+
}
636+
624637
/**
625638
* Sets the project description.
626639
*

0 commit comments

Comments
 (0)