Skip to content

Commit 8c2a68d

Browse files
committed
Implemented ability to run git log against a specific file and include a diff
1 parent 0d1a996 commit 8c2a68d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Git.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,16 @@ public function pull($remote, $branch) {
646646
* @param strgin $format
647647
* @return string
648648
*/
649-
public function log($format = null) {
649+
public function log($format = null, $fulldiff=false, $filepath=null) {
650+
651+
if ($fulldiff){
652+
$diff = "--full-diff -p ";
653+
}
654+
650655
if ($format === null)
651-
return $this->run('log');
656+
return $this->run('log ' . $diff . $filepath);
652657
else
653-
return $this->run('log --pretty=format:"' . $format . '"');
658+
return $this->run('log --pretty=format:"' . $format . '" ' . $diff .$filepath);
654659
}
655660

656661
/**

0 commit comments

Comments
 (0)