layout
default
menu_item
api
title
Revwalk
description
Version 0.26.1
return_to
API Documentation Index
/api/
sections
create
#commitWalk
#fastWalk
#fileHistoryWalk
#getCommits
#getCommitsUntil
#hide
#hideGlob
#hideHead
#hideRef
#next
#push
#pushGlob
#pushHead
#pushRange
#pushRef
#repository
#reset
#simplifyFirstParent
#sorting
#walk
SORT
#create
#commitWalk
#fastWalk
#fileHistoryWalk
#getCommits
#getCommitsUntil
#hide
#hideGlob
#hideHead
#hideRef
#next
#push
#pushGlob
#pushHead
#pushRange
#pushRef
#repository
#reset
#simplifyFirstParent
#sorting
#walk
#SORT
var revwalk = Revwalk . create ( repo ) ;
Parameters
Type
repo
Repository
the repo to walk through
revwalk . commitWalk ( max_count ) . then ( function ( stdVectorGitCommit ) {
// Use stdVectorGitCommit
} ) ;
| Parameters | Type |
| --- | --- | --- |
| max_count | Number | |
Returns
StdVectorGitCommit
revwalk . fastWalk ( max_count ) . then ( function ( stdVectorGitOid ) {
// Use stdVectorGitOid
} ) ;
| Parameters | Type |
| --- | --- | --- |
| max_count | Number | |
Revwalk# fileHistoryWalk Async
revwalk . fileHistoryWalk ( filePath , max_count ) . then ( function ( arrayHistoryEntry ) {
// Use arrayHistoryEntry
} ) ;
| Parameters | Type |
| --- | --- | --- |
| filePath | String | |
| max_count | Number | |
Returns
Array<historyEntry>
revwalk . getCommits ( count ) . then ( function ( arrayCommit ) {
// Use arrayCommit
} ) ;
Get a number of commits.
| Parameters | Type |
| --- | --- | --- |
| count | Number | (default: 10) |
Revwalk# getCommitsUntil Async
revwalk . getCommitsUntil ( checkFn ) . then ( function ( array ) {
// Use array
} ) ;
Walk the history grabbing commits until the checkFn called with the
current commit returns false.
| Parameters | Type |
| --- | --- | --- |
| checkFn | Function | function returns false to stop walking |
var result = revwalk . hide ( commit_id ) ;
| Parameters | Type |
| --- | --- | --- |
| commit_id | Oid | the oid of commit that will be ignored during the traversal |
Returns
Number
0 or an error code
var result = revwalk . hideGlob ( glob ) ;
| Parameters | Type |
| --- | --- | --- |
| glob | String | the glob pattern references should match |
Returns
Number
0 or an error code
var result = revwalk . hideHead ( ) ;
Returns
Number
0 or an error code
var result = revwalk . hideRef ( refname ) ;
| Parameters | Type |
| --- | --- | --- |
| refname | String | the reference to hide |
Returns
Number
0 or an error code
revwalk . next ( ) . then ( function ( oid ) {
// Use oid
} ) ;
Returns
Oid
the oid of the next commit
var result = revwalk . push ( id ) ;
| Parameters | Type |
| --- | --- | --- |
| id | Oid | the oid of the commit to start from. |
Returns
Number
0 or an error code
var result = revwalk . pushGlob ( glob ) ;
| Parameters | Type |
| --- | --- | --- |
| glob | String | the glob pattern references should match |
Returns
Number
0 or an error code
var result = revwalk . pushHead ( ) ;
Returns
Number
0 or an error code
var result = revwalk . pushRange ( range ) ;
| Parameters | Type |
| --- | --- | --- |
| range | String | the range |
Returns
Number
0 or an error code
var result = revwalk . pushRef ( refname ) ;
| Parameters | Type |
| --- | --- | --- |
| refname | String | the reference to push |
Returns
Number
0 or an error code
var repository = revwalk . repository ( ) ;
Revwalk# simplifyFirstParent Sync
revwalk . simplifyFirstParent ( ) ;
Set the sort order for the revwalk. This function takes variable arguments
like revwalk.sorting(NodeGit.RevWalk.Topological, NodeGit.RevWalk.Reverse).
| Parameters | Type |
| --- | --- | --- |
| sort | Number | |
revwalk . walk ( oid , callback ) ;
Walk the history from the given oid. The callback is invoked for each commit;
When the walk is over, the callback is invoked with (null, null).
| Parameters | Type |
| --- | --- | --- |
| oid | Oid | |
| callback | Function | |
| Flag | Value |
| --- | --- | --- |
| Revwalk.SORT. NONE | 0 |
| Revwalk.SORT. TOPOLOGICAL | 1 |
| Revwalk.SORT. TIME | 2 |
| Revwalk.SORT. REVERSE | 4 |