Skip to content

Latest commit

 

History

History
269 lines (199 loc) · 6.31 KB

File metadata and controls

269 lines (199 loc) · 6.31 KB
layout default
menu_item api
title Revwalk
description Version 0.5.0
return_to
API Documentation Index
/api/
sections
create #getCommits #getCommitsUntil #hide #hideGlob #hideHead #hideRef #next #push #pushGlob #pushHead #pushRange #pushRef #repository #reset #simplifyFirstParent #sorting #walk SORT
#create
#getCommits
#getCommitsUntil
#hide
#hideGlob
#hideHead
#hideRef
#next
#push
#pushGlob
#pushHead
#pushRange
#pushRef
#repository
#reset
#simplifyFirstParent
#sorting
#walk
#SORT

Revwalk.create Sync

var revwalk = Revwalk.create(repo);
Parameters Type
repo Repository the repo to walk through
Returns
Revwalk

Revwalk#getCommits Sync

var arrayCommit = revwalk.getCommits(count);

Get a number of commits.

| Parameters | Type | | --- | --- | --- | | count | Number | (default: 10) |

Returns
Array<Commit>

Revwalk#getCommitsUntil Sync

var array = revwalk.getCommitsUntil(checkFn);

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 |

Returns
Array

Revwalk#hide Sync

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

Revwalk#hideGlob Sync

var result = revwalk.hideGlob(glob);

| Parameters | Type | | --- | --- | --- | | glob | String | the glob pattern references should match |

Returns
Number 0 or an error code

Revwalk#hideHead Sync

var result = revwalk.hideHead();
Returns
Number 0 or an error code

Revwalk#hideRef Sync

var result = revwalk.hideRef(refname);

| Parameters | Type | | --- | --- | --- | | refname | String | the reference to hide |

Returns
Number 0 or an error code

Revwalk#next Async

revwalk.next().then(function(oid) {
  // Use oid
});
Returns
Oid the oid of the next commit

Revwalk#push Sync

var result = revwalk.push(id);

| Parameters | Type | | --- | --- | --- | | id | Oid | the oid of the commit to start from. |

Returns
Number 0 or an error code

Revwalk#pushGlob Sync

var result = revwalk.pushGlob(glob);

| Parameters | Type | | --- | --- | --- | | glob | String | the glob pattern references should match |

Returns
Number 0 or an error code

Revwalk#pushHead Sync

var result = revwalk.pushHead();
Returns
Number 0 or an error code

Revwalk#pushRange Sync

var result = revwalk.pushRange(range);

| Parameters | Type | | --- | --- | --- | | range | String | the range |

Returns
Number 0 or an error code

Revwalk#pushRef Sync

var result = revwalk.pushRef(refname);

| Parameters | Type | | --- | --- | --- | | refname | String | the reference to push |

Returns
Number 0 or an error code

Revwalk#repository Sync

var repository = revwalk.repository();
Returns
Repository the repository being walked

Revwalk#reset Sync

revwalk.reset();

Revwalk#simplifyFirstParent Sync

revwalk.simplifyFirstParent();

Revwalk#sorting Sync

revwalk.sorting(sort);

Set the sort order for the revwalk. This function takes variable arguments like revwalk.sorting(NodeGit.RevWalk.SORT.Topological, NodeGit.RevWalk.SORT.Reverse).

| Parameters | Type | | --- | --- | --- | | sort | Number | |

Revwalk#walk Sync

var commit = 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 | |

Returns
Commit

Revwalk.SORT ENUM

| Flag | Value | | --- | --- | --- | | Revwalk.SORT.NONE | 0 | | Revwalk.SORT.TOPOLOGICAL | 1 | | Revwalk.SORT.TIME | 2 | | Revwalk.SORT.REVERSE | 4 |