Giter VIP home page Giter VIP logo

changed-log's Introduction

changed-log

Returns all commit messages between 2 versions of an NPM module

NPM

Circle CI Travis CI semantic-release manpm

Install

npm install -g changed-log

How to use

What has changed for module 'chalk' between version 0.3.0 and 0.5.1?

$ changed-log chalk 0.3.0 0.5.1
found 30 commits finishing with the latest commit 994758f
Changelog for module chalk repo chalk/chalk from 0.3.0 to 0.5.1

0.5.1
  994758f: 0.5.1
  ca250ab: Merge pull request #33 from seanmonstar/_styles
  7ef6f4c: dont use slice on arguments
  4291833: return a new function for each getter

0.5.0
  3073fa3: 0.5.0
  af17529: use rawgithub to workaround npm website bug with relative image paths
  3ab833d: bench - increase iterations for more reliable results
  ...

0.4.0
  0a33a27: 0.4.0
  ...
  15f928f: Update readme

The information is fetched from the github repo corresponding to the NPM package. Alternatively you can provide github username / repo instead of NPM package name

$ changed-log kensho/ng-describe 0.3.0 0.5.0

For private repos, you can authenticate one time (including 2Factor) by passing commandline option --auth with the command

Edge cases

To find all changes between a module and the latest release use the command

$ changed-log <name> <from> latest
$ changed-log pre-git 1.2.0 latest

You can omit "latest" and just specify name and "from" version

$ changed-log <name> <from>

If you only provide a single version from a folder that contains package.json it will read the 'from' version from the the package.json, assuming you have only provided the 'to' version

$ changed-log <name> <to>
# reads name "from" version in the package.json

If you do not provide any version information, it tries to read 'from' version in the package.json and uses latest for 'to' version

$ changed-log <name>
# shows list of commits between the current version in package.json and latest

Using as a module

You can use changed-log as a module from your application.

var changedLog = require('changed-log');
// exports single function
changedLog(options, reportingOptions);
/*
  options = {
    auth: true | false - ask user to authenticate, optional
    name: <string> - package name OR <github username/repo name> to go directly to Github
    from: <string> - first tag
    to: <string> - second tag
  },
  reportingOptions = {
    details: true | false - prints the full commit message if true, otherwise just first line
  }
*/

The changedLog function returns a promise, resolved after report printing is complete. The promise is resolved with an instance of Report, see src/report.js

Debug

If something is not working, you can see verbose log output, just run the program with DEBUG=changed environment variable set

DEBUG=changed changed-log ...

Small print

Author: Gleb Bahmutov © 2015

License: MIT - do anything with the code, but don't blame me if it does not work.

Spread the word: tweet, star on github, etc.

Support: if you find any problems with this module, email / tweet / open issue on Github

MIT License

Copyright (c) 2015 Gleb Bahmutov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

changed-log's People

Contributors

bahmutov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

changed-log's Issues

Better error when cannot find commit tag

Currently just crashes

Fatal Error: cannot to tag 1.3.0 all tags array with 3 items.
[{
  "name": "1.2.0",
  "sha": "4a1323aff5d9c90d1e4e9cf4067048d609f01832"
},{
  "name": "1.1.0",
  "sha": "b2649806a755b9fff4f71511490cc266d7f2c5ab"
},{
  "name": "1.0.0",
  "sha": "a3126aa7a4dca3000c4993aecd9c6444cde6ec0f"
}]

    at lazyAssLogic (/Users/gleb/.nvm/versions/node/v6.7.0/lib/node_modules/changed-log/node_modules/lazy-ass/index.js:110:14)
    at lazyAss (/Users/gleb/.nvm/versions/node/v6.7.0/lib/node_modules/changed-log/node_modules/lazy-ass/index.js:115:28)
    at /Users/gleb/.nvm/versions/node/v6.7.0/lib/node_modules/changed-log/src/get-commits-from-tags.js:83:7

If available only list feat and fixes

If the most repo commit messages follow style, like this https://www.npmjs.com/package/validate-commit-msg

simple-bin-help 1.2.0 -> 1.3.0
Changelog for module simple-bin-help repo bahmutov/simple-bin-help from 1.2.0 to 1.3.0

1.3.0
  cfa6235: fix(es6): allow const keywords under Node 0.12
  79b031c: feat(help): Showing help message on -h or --help
  92d9936: feat(update): Calling updater-notifier automatically if there is package information
  f6ef63d: feat(callback): Added onFail callback to be called if fails to check arguments
  1c6a1b2: test(ci): running lint on ci before unit tests
  c666683: style(standard): Trying standard javascript

then filter and print just feat and fix

Find way to mock github API to avoid throttling during unit tests

For example DEBUG=changed node bin/changed-log.js chalk 0.3.0 0.5.1 during Travis CI test causes a problem

Could not find commit ids
{"message":"API rate limit exceeded for 52.0.240.122. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}

Allow 'latest' tag

When only a single tag is given, assume fetching commits between the latest and the given tag

Does not allow just "from" version

For example

$ changed-log safe-env 1.0.0
using "from" version from package.json 1.0.0
found 0 comments between tags
Changelog for module safe-env repo bahmutov/safe-env from 1.0.0 to 1.0.0

Should print similar to

$ changed-log safe-env 1.0.0 1.2.0
found 3 comments between tags
Changelog for module safe-env repo bahmutov/safe-env from 1.0.0 to 1.2.0

1.2.0
  4a1323a: feat(fn): pass predicate function for custom filtering, closes #2

1.1.0
  b264980: feat(api): allows passing an object to be filtered, closes #1
  57a5068: chore(deps): upgraded dependencies

Fails to look up tags beyond last 30 commits

Example:

$ changed-log next-update 0.8.0
Could not find commit ids
Cannot find "from" tag 0.8.0
available tags 1.5.1, 1.5.0, 1.4.2, 1.4.1, 1.4.0, 1.3.0, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 0.0.12, 0.0.11, 0.0.10, 0.0.9, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, delete, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.0, 0.8.3
$ changed-log next-update 0.8.0 0.8.3
Could not find commit ids
Cannot find "from" tag 0.8.0
available tags 1.5.1, 1.5.0, 1.4.2, 1.4.1, 1.4.0, 1.3.0, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 0.0.12, 0.0.11, 0.0.10, 0.0.9, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, delete, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.0, 0.8.3

Add support for 2Factor auth

Need to ask the user for two factor auth code when logging in if the user uses one

trying to login to github bahmutov
Unhandled rejection {"message":"Must specify two-factor authentication OTP code.","documentation_url":"https://developer.github.com/v3/auth#working-with-two-factor-authentication"}

then set it as a header

Order the from / to tags automatically

When fetching the tags from the github, we can order the from/to tags if the user specified them differently. These should be equivalent

changed-log chalk 0.3.0 0.5.0
changed-log chalk 0.5.0 0.3.0

Cannot parse valid github url

Could not parse the following repo url could not extract user and repo name from github url git+https://github.com/tj/commander.js.git

Weird error without details sometimes

Sometimes getting this error locally and on CI

  changed just the repo +18ms { type: 'git', url: 'git+https://github.com/chalk/chalk.git' }
  changed { user: 'chalk', repo: 'chalk' } +0ms
Fatal undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.