Skip to content

Commit b4c369b

Browse files
committed
added revwalk doc to README
1 parent 9ddba66 commit b4c369b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,17 @@ for ($i = 0; $i< 10;$i++){
6767
));
6868
$parents = array($parent);
6969
}
70-
````
70+
````
71+
72+
## Revision Walking
73+
74+
````
75+
$repo = new Git2\Repository($path);
76+
$walker = new Git2\Walker($repo);
77+
/* specify HEAD oid */
78+
$walker->push("6e20138dc38f9f626107f1cd3ef0f9838c43defe");
79+
80+
foreach ($walker as $oid => $commit) {
81+
printf("oid: %s\n", $oid);
82+
printf("message: %s\n", $commit->getMessage());
83+
}

0 commit comments

Comments
 (0)