New paste Repaste Download
<?php
error_reporting(-1);
chdir('d:/sources/minetest');
$git = popen('git rev-list --all | git cat-file --batch', 'rb');
$data = array();
while (($s = fgets($git)) !== FALSE) {
if (!preg_match('/^(?P<hash>[0-9a-f]{40}) (?P<type>[a-z]+) (?P<size>\d+)$/', $s, $m)) {
throw new Exception("Unexpected format: *$s*");
};
$current = array(
'hash' => $m['hash'],
'type' => $m['type'],
'data' => fread($git, $m['size']),
);
//print_r($current);
$data[] = $current;
fgets($git);
}
pclose($git);
print_r($data);
Filename: None. Size: 564b. View raw, , hex, or download this file.

This paste expires on 2026-10-17 21:54:52.467095+00:00. Pasted through web.