rafinskipg / git-changelog Goto Github PK
View Code? Open in Web Editor NEWGenerates a git changelog, CLI or grunt plugin, inspired & based on Angular JS changelog generator
License: MIT License
Generates a git changelog, CLI or grunt plugin, inspired & based on Angular JS changelog generator
License: MIT License
Is there a plan to do this i the future? Since I am not using grunt at all, the command line option is likely the only one. Though it would be nice to have it built into the build system though. How hard is it? I would love to help. Though, need to learn to use this in command line first, ha.
or there is easier way to integrate into those two hot ones?
how does this work when you have tags? It seems to try to grab a tag from way back.
I find a bit silly to end up with several scopes
(eg: https://github.com/rafinskipg/git-changelog/blob/master/EXTENDEDCHANGELOG.md README
vs readme
) simply because the scope has been written with different cases. Couldn't it be uppercased/lowercased (or maybe have an option to enable that?)
When using a grunt task it does not search for the .changelogrc on the current dir where the script is runned
At the momment the repo_url is only used for the issues / commits link.
The git commands only work in the actuall git project.
I tried to run it with ./node_modules/git-changelog git-changelog
seems not really working. Is there a right way to do it if I do not want to install it globally?
Considering that the module works like a charm without grunt, would you mind removing grunt from the peerDependencies in the package.json ? It prevents using shrinkwrap as we don't use grunt at all. What do you think ?
Add the possibility to group by tags on the extended log just like here https://github.com/angular/angular.js/blob/master/CHANGELOG.md
Use this kind of commit messages to grep tag names :
chore(release): v1.4.0 codename(jaracimrman-existence)
Git does not provide the functionality of retrieving the history from a repository you have not downloaded.
In order to have the feature of logging remote repositories without being in a repo folder some code has to be written.
I think in terms of functionality it should do something like this:
Whenever a user types -r REPO_URL on a folder that it's not a git repo:
Create a folder called .tmp (in the git-changelog directory?)
Go into that folder and clone the remote repo
Do the git log in that repo
Remove the folder .tmp after some time.
This will be time expensive.. but i think its a cool feature
i've got this config:
{
"app_name": "processo",
"logo": "https://github.com/rafinskipg/git-changelog/raw/master/images/git-changelog-logo.png",
"intro": "Projeto de controle",
"branch" : "master",
"repo_url": "git@xxxxxx:xxxxxx/processo.git",
"version" : "v1.0.0",
"file": "CHANGELOG.md",
"sections": [
{
"title": "Correções de Bug",
"grep": "(\[FIX\])|correção/i"
},
{
"title": "Features",
"grep": "\[FEATURE\]"
},
{
"title": "Erro 500",
"grep": "\[500\]"
},
{
"title": "Refactoração",
"grep": "\[REFACTOR\]"
},
{
"title": "Test",
"grep": "\[TEST\]"
},
]
}
i use this command:
git changelog -r [email protected]:xxxxxxx/processo.git
and i get this output:
Executing git changelog:
- With URL [email protected]:xxxxxxx/processo.git
Found changelog rc
Sorry, you've not configured an origin remote or passed a `repo_url` config value
what am i doing wrong?
I am trying to use this plugin but doesn't work.
Every time I try to run task git_changelog
the console show me log Warning: Task "git_changelog" not found. Use --force to continue
Here's everything, I tried with --debug
but it's not returning any better error:
slobodan:webapp 🚀 git-changelog -a "OMG! I Can Meditate." -d
Executing git changelog:
Debug enabled
- The APP name is OMG! I Can Meditate.
- The output file is CHANGELOG.md
Error generating changelog undefined
Remove deprecated option's names and ensure that there are not duplicated functionalities
As specified in the readme , finish the enhancement of grouping commits by tag
How are people dealing with the automatically generated commit messages? I get 'warning incorrect commit messages' for these.
ex:
'Merge pull request #5 from ...'
'Merge branch 'feature A'
@rafinskipg, what do you think of this as our project logo?
https://github.com/rafinskipg/git-changelog/blob/master/tasks/lib/print-header.js#L7
Why not let the image native width apply ?
Right now the new tests doesn't ensure that the functionality is working, instead they ensure certain paths of the code are used, make use of sinon for ensuring certain functions are called. Stub and compare if provided params are ok.
Sorry to be the evil-one, but I would like to use this tool to generate change logs for a closed-source project. To do this, I need
I'm happy to write the pull request for this, but I would like some advice on how to pass options object through to the relevant parts of the code, as I'm new to the require
style of programming used in this project.
Here's my configuration:
grunt.config('git_changelog', {
minimal : {
options: {
app_name : grunt.file.readJSON('project-config.json').git_changelog.app_name,
debug: true,
file : "../CHANGELOG.md"
}
}
});
When run:
Executing git changelog:
Running "git_changelog:minimal" (git_changelog) task
Error generating changelog [TypeError: Cannot call method 'indexOf' of undefined]
Error generating changelog [TypeError: Cannot call method 'indexOf' of undefined]
Hey,
I've added git-changelog
to a project and though it works very well, I was quite surprised to see that the default (and only, afaict) behaviour is to overwrite the CHANGELOG.
Did I miss an option? Are there any plans in 0.2
to change that behaviour?
FWIW, I've had to do the following to have it append:
Ensure that the options works as described.
For that it has been created a msg
that is getting constructed through the changelog.generate
method, then it can be parsed on the tests to ensure that certain conditions have been met.
describe('Params tests', function() {
it('should read log since beggining if tag is false', function(done) {
var options = _.cloneDeep(defaults);
options.tag = false;
options.name = 'my name';
ch.generate(options)
.then(function(opts){
expect(opts.msg).to.be.a('string');
expect(opts.msg.indexOf('since beggining')).to.not.equal(-1);
done();
})
.catch(function(err){
console.log('error', err);
})
});
});
E.g. Invalid changelogrc file
is pretty crucial; I didn't realise this was the issue until I ran with --debug
.
Alternatively some warnings could be upgraded to errors.
I have my config as such ( removing some internal stuff)
git_changelog: {
release_notes: {
options: {
file: 'RELEASE_NOTES.md',
app_name: 'TEST',
repo_url: 'https://<internal git lab host>/<group>/<test>',
grep_commits: '^fix|^feat|^docs|^refactor|^chore|^style|^test|BREAKING'
}
}
}
and when I generate the change log the link to the commit gets formatted as such
https://///commits/426fc8efaea3b245f7ca07532e9edee644f3fe42
For some reason it has 'commits' instead of 'commit' which messes up the link
Hi @JohnnyEstilles ,
I have started working on the .changelogrc specification for the version 0.2.0 , but previously i'm doing some refactors, i have started with the logger and i will continue this week.
I would like you to take a look to the specification and let me know if you have any thought about it : https://github.com/rafinskipg/git-changelog/tree/changelogrc#changelogrc-specification
Also i will create a issue with the things needed for 0.2.0
Thanks
Found that .writeChangelog()
(which is called by .generate()
does not wait for the open
event on its stream
parameter. When stream
is set to stdout
by .generate()
its no big deal. If the file passed to fs.createWriteStream()
already exists it's also not an issue. However, if the file doesn't exists then writing to the stream may sporadically fail with an ENOENT error.
I propose refactoring .writeChangelog()
into an asynchronous method (so that it can wait for the open event) that returns a promise to .generate()
.
Will add this fix to PR #20.
For example for a single commit message I have
feat(ad): make new ad
some note here
reg(ad): need a walk through
so in the 3rd line, there will be a reg
tag, but even I added in the changelogrc, it seems still not get recognized.
How can I make it recognizable even its not at the beginning of the commit message?
When you are using the grunt task, it launches also the cli option
This is because the bin
is defined on the package.json
"bin": {
"git-changelog": "tasks/command.js"
},
This causes that it executes it 2 times..
Lets for example if I am in a feature branch, I generated the change log... in compare with a choose branch and only show changes in diff between those two specific branches. How can I do that? I did not see a way I can do it yet.
Any guidance on this?
Thanks!!!
Running "git_changelog:minimal" (git_changelog) task
THemaster
Reading git log since changelog-start
Executing : git log develop --grep="^fix|^feat|^docs|BREAKING" -E --format=%H%n%s%n%b%n==END== undefined..HEAD
Parsed 0 commits
Generating changelog to CHANGELOG.md ( )
Running "git_changelog:extended" (git_changelog) task
THemaster
Reading git log since changelog-start
Executing : git log develop --grep="^fix|^feat|^docs|^refactor|^chore|BREAKING" -E --format=%H%n%s%n%b%n==END== undefined..HEAD
Parsed 0 commits
Generating changelog to CHANGELOG.md ( )
Change the task options to:
{
sections: [
{
name: 'Features', //title of the section
grep: '^feat', //grep the commits that start with "feat"
commitLInks : true //link descriptions to commit url.
},
{
name: 'Documentation',
grep: '^docs'
}
],
ignoreTags: false, //Parse since the beggining of the repository, instead of the last tag.
file: 'changelogs/CHANGELOG.md, //Output
},
Where:
File can be
file: {
'dir' : 'changelogs/'
'name': 'CHANGELOG.%version%.%date%.md' //Allowing template with some values
}
I personally favor Bluebird, but I'm open to suggestions. :-)
Lists of tasks needed :
For v1
Was thinking it would be great if you could run this straight from the terminal as a cli also. That way you could do a global install, set up a few config options and simply call it from the command line. It might read the repo package.json file to retrieve the url and name so you don't have to pass that along.
Just downloaded and gave this a try and it works pretty good. However, I've noticed there's a few unanswered issues and I'm wondering if this is because you're no longer maintaining this project. If not are you using another tool to achieve this? I'd be keen to know as I've tried a few unsuccessfully.
Thanks.
Version option should only be used if :
If a tag is provided, use this format:
Note that version would be 'Version Name'
fs-extra has an #createOutputStream
method that is exactly like fs#createWriteStream
, but if the directory does not exist, it's created. This will allow us to simply the logic in Changelog#generate
.
This refactoring will be a backwards compatible change.
What do you say @rafinskipg?
I am testing out the cli version of this tool with the following log
commit 5cbf787a298973464145b35b330b869bf8dd28a3
Author: angelblade27
Date: Tue Jan 5 12:40:34 2016 -0800
chore(package.json): Release v0.3.12
commit d67631933436705d857c3a8873af414a5149fb39
Merge: 3a4f3c6 21d6373
Author: angelblade27
Date: Tue Jan 5 19:51:14 2016 +0000
Merge branch 'validate-msg' into 'master'
fix(validate-commit-msg.js): Fix character length validation against short description
# Description
Validation against the commit msg for character count consider the entire commit message rather than just the short description this changes breaks the commit message into different parts and validates against the short description
commit 3a4f3c64b848e27dafc489aa27a879766107fa4f
commit 4233745b45e000f55a054f76ad1a74e8aaccb4af
Author: angelblade27
Date: Tue Jan 5 10:43:09 2016 -0800
style(push-hook): Fix done outputs
however when i run the changelog it doesnt parse anything
git-changelog -d -t v.0.3.11
Executing git changelog:
Debug enabled
- Generating log since tag v.0.3.11
- The APP name is My app - Changelog
- The output file is CHANGELOG.md
Reading git log since v.0.3.11
Executing : git log --grep="^fix|^feat|^docs|BREAKING" -E --format=%H%n%s%n%b%n==END== v.0.3.11..HEAD
Parsed 0 commits
Generating changelog to CHANGELOG.md ( )
Finished generating log Yai!
It looks like it parsed nothing.
1.) What am I doing wrong?
2.) Will it parse the merge requests?
I want this project to be a grunt plugin, available to be installed with npm
I want the gruntfile to allow configuration for:
Hi,
I have following commit message
BREAKING: String.As has been changed to BaseUrl to better describe it feature: T.String for Encode and Typed for Decode
It isn't added to changelog, is there something missing or i am doing wrong? Is there something there for multiple sections data in single commit just like this one?
Thanks
Generate changelogs with custom logo embebed
options: {
file: 'MyChangelog.md',
logo: './images/logo.png',
app_name : 'Git changelog'
}
Adding this markup to the file
<a name="">Version 0.2.0</a>
<img width="300px" src="http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png" />
__Git changelog__
_a project by Google Corp_
# v0.2.0 (2015-04-21)
## Bug Fixes
That will generate a similar output to this:
@rafinskipg, I completely agree with issues #16 and #18. We definitely need to increase test coverage and usingsinon
would be a great addition to the test suite.
That said, as-is the existing code-base is somewhat difficult to test. Before you proceed with 0.2.0
I suggest the following:
git_changelog
grunt task, replace with fixtures so test input is predictablesinon
to stub and spy on calls to external functionsAdditionally, I would:
0.12.x
to travis-ci configurationI'll be more than happy to assist with a PR.
Two little formatting issues that are closely related.
feature
the sub list displays inline rather than giving each new item a new line.type
list are also not displaying correctly on their own new line. I suspect that this may be related/flowing on from the previous issue.See the below example that was generated from a demo repo I setup.
Example 1 Output: Start
Example 1 Output: End
I'm assuming the above should look more like:
Example 2 Output: Start
Example 2 Output: End
Is it possible to have sections grouped by tags from the beginning of the log history? currently enabling tags will only show changes till the last tag but I want to have the changes grouped by those tags.
I removed the version from the rc to that it uses the last tag but it doesn't.
version: The version of the project. Defaults to , DEPRECATED will default to the tag name
Is the defaulting deprectated or is version deprecated?
Found changelog rc
- The APP name is <name>Changelog
- The output file is CHANGELOG.md
Reading git log since #205
Generating changelog to CHANGELOG.md ( )
Finished generating log Yai!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.