Skip to content

Commit fa5acd4

Browse files
authored
Merge pull request #13 from tkskto/fix/update-version
Fix/update version
2 parents 81c1d84 + 3eebcbc commit fa5acd4

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ See the [types](./types/index.d.ts) for details.
3838

3939
#### `Author.commitCount`: number
4040

41+
### Branches
42+
43+
#### branches.local: string[]
44+
45+
#### branches.remote: Record<string, string[]>
46+
4147
### Commit
4248

4349
#### `Commit.author`: [Pick<Author, 'email' | 'name'>](#Author)
@@ -62,8 +68,12 @@ Type of `Remote` is `Record<string, { fetch: string, push: string }>`. `Record`
6268

6369
#### `Remote.origin.fetch`: string
6470

71+
`origin` is remoteName. It depends on your settings.
72+
6573
#### `Remote.origin.push`: string
6674

75+
`origin` is remoteName. It depends on your settings.
76+
6777
## Functions
6878

6979
See the [types](./types/index.d.ts) for details.
@@ -88,9 +98,25 @@ filtering logs with branchName. default is `'HEAD'`.
8898

8999
* [Author](#Author)
90100

91-
### [WIP] branches()
101+
### branches()
102+
103+
Get branch info with `git branch` command.
104+
105+
#### Since
106+
107+
0.3.0
108+
109+
#### Arguments
110+
111+
* withRemote
112+
113+
##### withRemote: boolean
114+
115+
To get remote info, set it `true`. default is `true`.
116+
117+
#### Returns
92118

93-
Get branch info.
119+
* [Branches](#Branches)
94120

95121
### commits()
96122

@@ -106,15 +132,15 @@ Get commit info with `git log` command.
106132

107133
##### `logOption.count`: number
108134

109-
how many log to get. default is `1000`. `0` is no limit.
135+
How many log to get. default is `1000`. `0` is no limit.
110136

111137
##### `logOption.withFile`: boolean
112138

113-
whether to get file name. default is `false`.
139+
Whether to get file name. default is `false`.
114140

115141
##### `logOption.branch`: string
116142

117-
filtering logs with branch name. default is `''`.
143+
Filtering logs with branch name. default is `''`.
118144

119145
#### Returns
120146

__tests__/spec/branches.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ describe('branch test', () => {
1010
expect(branch.local.length).toStrictEqual(1);
1111
expect(branch.remote).toBeUndefined();
1212
} else {
13+
// TODO: it must be failed.
1314
expect(branch).toStrictEqual({
1415
local: [
15-
'feature/add-branches',
16-
'feature/add-remote-details',
1716
'main'
1817
],
1918
});
@@ -30,14 +29,13 @@ describe('branch test', () => {
3029
expect(branch.remote.pull.length).toStrictEqual(1);
3130
}
3231
} else {
32+
// TODO: it must be failed.
3333
expect(branch).toStrictEqual({
3434
local: [
35-
'feature/add-branches',
36-
'feature/add-remote-details',
3735
'main'
3836
],
3937
remote: {
40-
origin: [ 'feature/add-branches', 'main' ],
38+
origin: [ 'main' ],
4139
},
4240
});
4341
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-log-nodejs",
3-
"version": "0.1.1",
3+
"version": "0.3.1",
44
"description": "git-log-nodejs is a tool to get git logs.",
55
"main": "dist/index.js",
66
"types": "types/index.d.ts",

0 commit comments

Comments
 (0)