Socket
Socket
Sign inDemoInstall

commit-stream

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commit-stream - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [2.1.0](https://github.com/rvagg/commit-stream/compare/v2.0.1...v2.1.0) (2023-05-16)
### Features
* add support for green-button merges ([9e87160](https://github.com/rvagg/commit-stream/commit/9e87160f261d67ea0a3a6c4a02136b5c50ecfa42))
## [2.0.1](https://github.com/rvagg/commit-stream/compare/v2.0.0...v2.0.1) (2023-04-04)

@@ -2,0 +9,0 @@

5

commit-stream.js

@@ -49,3 +49,3 @@ import through2 from 'through2'

commit.reviewers.push({ name: m[1], email: m[2] })
} else if ((m = line.match(/^\s+PR(?:[- ]?URL)?:?\s*(.+)\s*$/)) !== null) {
} else if ((m = line.match(/^\s+PR(?:[- ]?URL)?:?\s*(.+)\s*$/) || line.match(/\(#(\d+)\)$/)) !== null) {
commit.prUrl = m[1]

@@ -70,2 +70,5 @@ if (

}
if ((m = line.match(/^ {4}(.*)\s\(#\d+\)$/)) && !commit.summary) {
commit.summary = m[1]
}
} else if (/^ {4}/.test(line) && (line = line.trim()).length !== 0) {

@@ -72,0 +75,0 @@ if (commit.summary === undefined || commit.summary === null) {

2

package.json
{
"name": "commit-stream",
"version": "2.0.1",
"version": "2.1.0",
"description": "Turn a `git log` into a stream of commit objects",

@@ -5,0 +5,0 @@ "main": "commit-stream.js",

@@ -50,3 +50,3 @@ # commit-stream

- `prUrl`: a URL pointing to a pull-request where this change was made if the commit metadata contains a `PR-URL: https://github.com/user/project/pull/XX` line. Note that whatever proceeds the `PR-URL: ` string will be collected in this property; one exception being that if a shortened `#XX` version is found and you have supplied `defaultGitHubUser` and `defaultGitHubProject` arguments to the constructor then a full GitHub pull-request will be reconstituted in its place.
- `ghUser`, `ghProject`, `ghIssue`: if a proper GitHub pull request is found for the `prUrl` property (including shortened `#XX` ones), these properties will be added to point to the original user, project and issue (pull-request) for this change, as extracted from the URL.
- `ghUser`, `ghProject`, `ghIssue`: if a proper GitHub pull request is found for the `prUrl` property (including shortened `#XX` ones), these properties will be added to point to the original user, project and issue (pull-request) for this change, as extracted from the URL. Also, if a commit message line ends with ` (#XX)` as is done with green-button merges, this will be used.

@@ -53,0 +53,0 @@ ## License

@@ -9,3 +9,8 @@ import commitStream from './commit-stream.js'

function gitToList (t, gitCmd, callback) {
function gitToList (t, gitCmd, user, repo, callback) {
if (typeof user === 'function') {
callback = user
user = undefined
repo = undefined
}
const child = spawn('bash', ['-c', gitCmd])

@@ -25,3 +30,3 @@ child.stderr.pipe(bl((_, out) => {

split2(),
commitStream(),
commitStream(user, repo),
listStream.obj(callback),

@@ -202,1 +207,23 @@ () => {}

})
test('current commit log with ghUser and ghRepo passed', function (t) {
gitToList(t, 'git log', 'rvagg', 'commit-stream', function (err, list) {
t.error(err, 'no error')
t.ok(list && list.length > 1, 'got a list')
t.deepEqual(list[list.length - 18], {
sha: 'b23208796d7e3fd08b36f6106aa7f027aa827137',
authors: [
{ name: 'Rich Trott', email: 'rtrott@gmail.com' }
],
authorDate: 'Mon Oct 11 19:29:18 2021 -0700',
prUrl: 'https://github.com/rvagg/commit-stream/pull/5',
ghIssue: 5,
ghUser: 'rvagg',
ghProject: 'commit-stream',
author: { name: 'Rich Trott', email: 'rtrott@gmail.com' },
summary: 'chore: update strip-ansi to 6.x'
}, 'got correct pr url for green-button merge')
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc