Skip to content

Commit 4de6d73

Browse files
authored
Merge pull request kbjr#50 from bentasker/log-changes
Implemented ability to run git log against a specific file
2 parents ccbc201 + 0acceb8 commit 4de6d73

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Git.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,21 @@ public function pull($remote = "", $branch = "") {
654654
* @param strgin $format
655655
* @return string
656656
*/
657-
public function log($format = null) {
657+
public function log($format = null, $fulldiff=false, $filepath=null, $follow=false) {
658+
659+
if ($fulldiff){
660+
$diff = "--full-diff -p ";
661+
}
662+
663+
if ($follow){
664+
// Can't use full-diff with follow
665+
$diff = "--follow -- ";
666+
}
667+
658668
if ($format === null)
659-
return $this->run('log');
669+
return $this->run('log ' . $diff . $filepath);
660670
else
661-
return $this->run('log --pretty=format:"' . $format . '"');
671+
return $this->run('log --pretty=format:"' . $format . '" ' . $diff .$filepath);
662672
}
663673

664674
/**

0 commit comments

Comments
 (0)