FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/example/convenience-commit.js at v0.0.79 · nodegit/nodegit · GitHub
nodegit
nodegit
Repository navigation
Code
Issues
344
(344)
Pull requests
21
(21)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
example
/
convenience-commit.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (44 loc) · 1.5 KB
Breadcrumbs
nodegit
/
example
/
convenience-commit.js
Copy path
File metadata and controls
48 lines (44 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Load in the module.
var
git
=
require
(
'nodegit'
)
,
async
=
require
(
'async'
)
;
// Open the repository in the current directory.
git
.
repo
(
'.git'
,
function
(
error
,
repository
)
{
if
(
error
)
throw
error
;
// Use the master branch (a branch is the HEAD commit)
repository
.
branch
(
'master'
,
function
(
error
,
branch
)
{
if
(
error
)
throw
error
;
// History returns an event, and begins walking the history
var
history
=
branch
.
history
(
)
;
// History emits 'commit' event for each commit in the branch's history
history
.
on
(
'commit'
,
function
(
error
,
commit
)
{
// Print out `git log` emulation.
async
.
series
(
[
function
(
callback
)
{
commit
.
sha
(
callback
)
;
}
,
function
(
callback
)
{
commit
.
date
(
callback
)
;
}
,
function
(
callback
)
{
commit
.
author
(
function
(
error
,
author
)
{
author
.
name
(
callback
)
;
}
)
;
}
,
function
(
callback
)
{
commit
.
author
(
function
(
error
,
author
)
{
author
.
email
(
callback
)
;
}
)
;
}
,
function
(
callback
)
{
commit
.
message
(
callback
)
;
}
]
,
function
printCommit
(
error
,
results
)
{
if
(
error
)
throw
error
;
console
.
log
(
'SHA '
+
results
[
0
]
)
;
console
.
log
(
results
[
1
]
*
1000
)
;
console
.
log
(
results
[
2
]
+
' <'
+
results
[
3
]
+
'>'
)
;
console
.
log
(
results
[
4
]
)
;
}
)
;
}
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL