git-raw-commits 1.3.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/LICENSE.md +21 -0
- package/cli.js +14 -16
- package/index.js +51 -51
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,48 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
<a name="2.0.0"></a>
|
|
7
|
+
# [2.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.6...git-raw-commits@2.0.0) (2018-05-29)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Chores
|
|
11
|
+
|
|
12
|
+
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* **package:** Set the package's minimum required Node version to be the oldest LTS
|
|
18
|
+
currently supported by the Node Release working group. At this time,
|
|
19
|
+
that is Node 6 (which is in its Maintenance LTS phase).
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<a name="1.3.6"></a>
|
|
25
|
+
## [1.3.6](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.5...git-raw-commits@1.3.6) (2018-03-27)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package git-raw-commits
|
|
31
|
+
|
|
32
|
+
<a name="1.3.5"></a>
|
|
33
|
+
## [1.3.5](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.4...git-raw-commits@1.3.5) (2018-03-22)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package git-raw-commits
|
|
39
|
+
|
|
40
|
+
<a name="1.3.4"></a>
|
|
41
|
+
## [1.3.4](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.3...git-raw-commits@1.3.4) (2018-02-24)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package git-raw-commits
|
|
47
|
+
|
|
6
48
|
<a name="1.3.3"></a>
|
|
7
49
|
## [1.3.3](https://github.com/conventional-changelog/conventional-changelog/compare/git-raw-commits@1.3.2...git-raw-commits@1.3.3) (2018-02-20)
|
|
8
50
|
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
### MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/cli.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict'
|
|
3
|
-
var meow = require('meow')
|
|
4
|
-
var gitRawCommits = require('./')
|
|
2
|
+
'use strict'
|
|
3
|
+
var meow = require('meow')
|
|
4
|
+
var gitRawCommits = require('./')
|
|
5
5
|
|
|
6
|
-
var cli = meow(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]
|
|
14
|
-
});
|
|
6
|
+
var cli = meow(`
|
|
7
|
+
Usage
|
|
8
|
+
git-raw-commits [<git-log(1)-options>]
|
|
9
|
+
|
|
10
|
+
Example
|
|
11
|
+
git-raw-commits --from HEAD~2 --to HEAD^`
|
|
12
|
+
)
|
|
15
13
|
|
|
16
14
|
gitRawCommits(cli.flags)
|
|
17
|
-
.on('error', function(err) {
|
|
18
|
-
process.stderr.write(err)
|
|
19
|
-
process.exit(1)
|
|
15
|
+
.on('error', function (err) {
|
|
16
|
+
process.stderr.write(err)
|
|
17
|
+
process.exit(1)
|
|
20
18
|
})
|
|
21
|
-
.pipe(process.stdout)
|
|
19
|
+
.pipe(process.stdout)
|
package/index.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
'use strict'
|
|
1
|
+
'use strict'
|
|
2
2
|
|
|
3
|
-
var dargs = require('dargs')
|
|
4
|
-
var execFile = require('child_process').execFile
|
|
5
|
-
var split = require('split2')
|
|
6
|
-
var stream = require('stream')
|
|
7
|
-
var template = require('lodash.template')
|
|
8
|
-
var through = require('through2')
|
|
3
|
+
var dargs = require('dargs')
|
|
4
|
+
var execFile = require('child_process').execFile
|
|
5
|
+
var split = require('split2')
|
|
6
|
+
var stream = require('stream')
|
|
7
|
+
var template = require('lodash.template')
|
|
8
|
+
var through = require('through2')
|
|
9
9
|
|
|
10
|
-
var DELIMITER = '------------------------ >8 ------------------------'
|
|
10
|
+
var DELIMITER = '------------------------ >8 ------------------------'
|
|
11
11
|
|
|
12
|
-
function normalizeExecOpts(execOpts) {
|
|
13
|
-
execOpts = execOpts || {}
|
|
14
|
-
execOpts.cwd = execOpts.cwd || process.cwd()
|
|
15
|
-
return execOpts
|
|
12
|
+
function normalizeExecOpts (execOpts) {
|
|
13
|
+
execOpts = execOpts || {}
|
|
14
|
+
execOpts.cwd = execOpts.cwd || process.cwd()
|
|
15
|
+
return execOpts
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function normalizeGitOpts(gitOpts) {
|
|
19
|
-
gitOpts = gitOpts || {}
|
|
20
|
-
gitOpts.format = gitOpts.format || '%B'
|
|
21
|
-
gitOpts.from = gitOpts.from || ''
|
|
22
|
-
gitOpts.to = gitOpts.to || 'HEAD'
|
|
23
|
-
return gitOpts
|
|
18
|
+
function normalizeGitOpts (gitOpts) {
|
|
19
|
+
gitOpts = gitOpts || {}
|
|
20
|
+
gitOpts.format = gitOpts.format || '%B'
|
|
21
|
+
gitOpts.from = gitOpts.from || ''
|
|
22
|
+
gitOpts.to = gitOpts.to || 'HEAD'
|
|
23
|
+
return gitOpts
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function getGitArgs(gitOpts) {
|
|
27
|
-
var gitFormat = template('--format=<%= format %>%n' + DELIMITER)(gitOpts)
|
|
28
|
-
var gitFromTo = [gitOpts.from, gitOpts.to].filter(Boolean).join('..')
|
|
26
|
+
function getGitArgs (gitOpts) {
|
|
27
|
+
var gitFormat = template('--format=<%= format %>%n' + DELIMITER)(gitOpts)
|
|
28
|
+
var gitFromTo = [gitOpts.from, gitOpts.to].filter(Boolean).join('..')
|
|
29
29
|
|
|
30
|
-
var gitArgs = ['log', gitFormat, gitFromTo]
|
|
30
|
+
var gitArgs = ['log', gitFormat, gitFromTo]
|
|
31
31
|
|
|
32
32
|
// allow commits to focus on a single directory
|
|
33
33
|
// this is useful for monorepos.
|
|
34
34
|
if (gitOpts.path) {
|
|
35
|
-
gitArgs.push('--', gitOpts.path)
|
|
35
|
+
gitArgs.push('--', gitOpts.path)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return gitArgs.concat(dargs(gitOpts, {
|
|
39
39
|
excludes: ['debug', 'from', 'to', 'format', 'path']
|
|
40
|
-
}))
|
|
40
|
+
}))
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function gitRawCommits(rawGitOpts, rawExecOpts) {
|
|
44
|
-
var readable = new stream.Readable()
|
|
45
|
-
readable._read = function() {}
|
|
43
|
+
function gitRawCommits (rawGitOpts, rawExecOpts) {
|
|
44
|
+
var readable = new stream.Readable()
|
|
45
|
+
readable._read = function () {}
|
|
46
46
|
|
|
47
|
-
var gitOpts = normalizeGitOpts(rawGitOpts)
|
|
48
|
-
var execOpts = normalizeExecOpts(rawExecOpts)
|
|
49
|
-
var args = getGitArgs(gitOpts)
|
|
47
|
+
var gitOpts = normalizeGitOpts(rawGitOpts)
|
|
48
|
+
var execOpts = normalizeExecOpts(rawExecOpts)
|
|
49
|
+
var args = getGitArgs(gitOpts)
|
|
50
50
|
|
|
51
51
|
if (gitOpts.debug) {
|
|
52
|
-
gitOpts.debug('Your git-log command is:\ngit ' + args.join(' '))
|
|
52
|
+
gitOpts.debug('Your git-log command is:\ngit ' + args.join(' '))
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
var isError = false
|
|
55
|
+
var isError = false
|
|
56
56
|
|
|
57
57
|
var child = execFile('git', args, {
|
|
58
58
|
cwd: execOpts.cwd,
|
|
59
59
|
maxBuffer: Infinity
|
|
60
|
-
})
|
|
60
|
+
})
|
|
61
61
|
|
|
62
62
|
child.stdout
|
|
63
63
|
.pipe(split(DELIMITER + '\n'))
|
|
64
|
-
.pipe(through(function(chunk, enc, cb) {
|
|
65
|
-
readable.push(chunk)
|
|
66
|
-
isError = false
|
|
64
|
+
.pipe(through(function (chunk, enc, cb) {
|
|
65
|
+
readable.push(chunk)
|
|
66
|
+
isError = false
|
|
67
67
|
|
|
68
|
-
cb()
|
|
69
|
-
}, function(cb) {
|
|
70
|
-
setImmediate(function() {
|
|
68
|
+
cb()
|
|
69
|
+
}, function (cb) {
|
|
70
|
+
setImmediate(function () {
|
|
71
71
|
if (!isError) {
|
|
72
|
-
readable.push(null)
|
|
73
|
-
readable.emit('close')
|
|
72
|
+
readable.push(null)
|
|
73
|
+
readable.emit('close')
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
cb()
|
|
77
|
-
})
|
|
78
|
-
}))
|
|
76
|
+
cb()
|
|
77
|
+
})
|
|
78
|
+
}))
|
|
79
79
|
|
|
80
80
|
child.stderr
|
|
81
|
-
.pipe(through.obj(function(chunk) {
|
|
82
|
-
isError = true
|
|
83
|
-
readable.emit('error', new Error(chunk))
|
|
84
|
-
readable.emit('close')
|
|
85
|
-
}))
|
|
81
|
+
.pipe(through.obj(function (chunk) {
|
|
82
|
+
isError = true
|
|
83
|
+
readable.emit('error', new Error(chunk))
|
|
84
|
+
readable.emit('close')
|
|
85
|
+
}))
|
|
86
86
|
|
|
87
|
-
return readable
|
|
87
|
+
return readable
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
module.exports = gitRawCommits
|
|
90
|
+
module.exports = gitRawCommits
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-raw-commits",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Get raw git commits out of your repository using git-log(1)",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=6.9.0"
|
|
21
|
+
},
|
|
19
22
|
"files": [
|
|
20
23
|
"index.js",
|
|
21
24
|
"cli.js"
|
|
@@ -32,21 +35,16 @@
|
|
|
32
35
|
"dependencies": {
|
|
33
36
|
"dargs": "^4.0.1",
|
|
34
37
|
"lodash.template": "^4.0.2",
|
|
35
|
-
"meow": "^
|
|
38
|
+
"meow": "^4.0.0",
|
|
36
39
|
"split2": "^2.0.0",
|
|
37
40
|
"through2": "^2.0.0"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
|
-
"chai": "^3.0.0",
|
|
41
|
-
"istanbul": "^0.4.2",
|
|
42
|
-
"jscs": "^2.0.0",
|
|
43
|
-
"jshint": "^2.8.0",
|
|
44
43
|
"mkdirp": "^0.5.1",
|
|
45
|
-
"
|
|
46
|
-
"shelljs": "^0.6.0"
|
|
44
|
+
"shelljs": "^0.8.0"
|
|
47
45
|
},
|
|
48
46
|
"scripts": {
|
|
49
|
-
"lint": "
|
|
47
|
+
"lint": "eslint --fix .",
|
|
50
48
|
"test": "npm run-script lint && mocha --timeout 30000",
|
|
51
49
|
"test-windows": "mocha --timeout 30000"
|
|
52
50
|
},
|