| layout |
default |
| menu_item |
api |
| title |
Note |
| description |
Version 0.19.0 |
| return_to |
| API Documentation Index |
/api/ |
|
| sections |
| create |
foreach |
iteratorNew |
next |
read |
remove |
#author |
#committer |
#free |
#id |
#message |
#create |
#foreach |
#iteratorNew |
#next |
#read |
#remove |
#author |
#committer |
#free |
#id |
#message |
|
Note.create(repo, notes_ref, author, committer, oid, note, force).then(function(oid) {
// Use oid
});
| Parameters |
Type |
|
| repo |
Repository |
repository where to store the note |
| notes_ref |
String |
canonical name of the reference to use (optional); defaults to "refs/notes/commits" |
| author |
Signature |
signature of the notes commit author |
| committer |
Signature |
signature of the notes commit committer |
| oid |
Oid |
OID of the git object to decorate |
| note |
String |
Content of the note to add for object oid |
| force |
Number |
Overwrite existing note |
Note.foreach(repo, notes_ref, note_cb, payload).then(function(result) {
// Use result
});
| Parameters |
Type |
|
| repo |
Repository |
Repository where to find the notes. |
| notes_ref |
String |
Reference to read from (optional); defaults to "refs/notes/commits". |
| note_cb |
NoteForeachCb |
Callback to invoke per found annotation. Return non-zero to stop looping. |
| payload |
Void |
Extra parameter to callback function. |
| Returns |
|
| Number |
0 on success, non-zero callback return value, or error code |
Note.iteratorNew(repo, notes_ref).then(function(noteIterator) {
// Use noteIterator
});
| Parameters |
Type |
|
| repo |
Repository |
repository where to look up the note |
| notes_ref |
String |
canonical name of the reference to use (optional); defaults to "refs/notes/commits" |
var result = Note.next(note_id, annotated_id, it);
| Parameters |
Type |
|
| note_id |
Oid |
id of blob containing the message |
| annotated_id |
Oid |
id of the git object being annotated |
| it |
NoteIterator |
pointer to the iterator |
| Returns |
|
| Number |
0 (no error), GIT_ITEROVER (iteration is done) or an error code |
Note.read(repo, notes_ref, oid).then(function(note) {
// Use note
});
| Parameters |
Type |
|
| repo |
Repository |
repository where to look up the note |
| notes_ref |
String |
canonical name of the reference to use (optional); defaults to "refs/notes/commits" |
| oid |
Oid |
OID of the git object to read the note from |
Note.remove(repo, notes_ref, author, committer, oid).then(function(result) {
// Use result
});
| Parameters |
Type |
|
| repo |
Repository |
repository where the note lives |
| notes_ref |
String |
canonical name of the reference to use (optional); defaults to "refs/notes/commits" |
| author |
Signature |
signature of the notes commit author |
| committer |
Signature |
signature of the notes commit committer |
| oid |
Oid |
OID of the git object to remove the note from |
| Returns |
|
| Number |
0 or an error code |
var signature = note.author();
var signature = note.committer();
| Returns |
|
| Oid |
the note object's id |
var string = note.message();
| Returns |
|
| String |
the note message |