Created
May 8, 2011 16:43
-
-
Save geeknam/961488 to your computer and use it in GitHub Desktop.
Revisions
-
geeknam revised this gist
May 8, 2011 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,22 +7,22 @@ exec("git log",$output); $history = array(); foreach($output as $line){ if(strpos($line, 'commit')===0){ if(!empty($commit)){ array_push($history, $commit); unset($commit); } $commit['hash'] = substr($line, strlen('commit')); } else if(strpos($line, 'Author')===0){ $commit['author'] = substr($line, strlen('Author:')); } else if(strpos($line, 'Date')===0){ $commit['date'] = substr($line, strlen('Date:')); } else{ $commit['message'] .= $line; } } print_r($history); -
geeknam revised this gist
May 8, 2011 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php // Author: Ngo Minh Nam $dir = "/path/to/your/repo/"; @@ -24,4 +25,6 @@ } } print_r($history); ?> -
geeknam revised this gist
May 8, 2011 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // Author: Ngo Minh Nam $dir = "/path/to/your/repo/"; $output = array(); chdir($dir); -
geeknam created this gist
May 8, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ $dir = "/path/to/your/repo/"; $output = array(); chdir($dir); exec("git log",$output); $history = array(); foreach($output as $line){ if(strpos($line, 'commit')===0){ if(!empty($commit)){ array_push($history, $commit); unset($commit); } $commit['hash'] = substr($line, strlen('commit')); } else if(strpos($line, 'Author')===0){ $commit['author'] = substr($line, strlen('Author:')); } else if(strpos($line, 'Date')===0){ $commit['date'] = substr($line, strlen('Date:')); } else{ $commit['message'] .= $line; } } print_r($history);