Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog not including commits for initial version #174

Closed
patlillis opened this issue Jul 14, 2020 · 4 comments
Closed

Changelog not including commits for initial version #174

patlillis opened this issue Jul 14, 2020 · 4 comments

Comments

@patlillis
Copy link

Summary

I have auto-changelog set up in my NPM "version" script as suggested in this project's README, but when I do npm version patch the first time, commits don't get included in the generated CHANGELOG.

In addition, the section in CHANGELOG.md for the initial version does not contain the v prefix.

Steps to reproduce issue:

  1. Start from empty directory
  2. Run following command to initialize directory:
    git init && npm init -y && npm install --save-dev auto-changelog
    
  3. Add to package.json scripts section:
    "version": "auto-changelog -p && git add CHANGELOG.md"
    
  4. Create an initial commit:
    git add --all && git commit -m "initial commit"
    
  5. Create an initial version:
    npm version patch
    

Expected results:

CHANGELOG.md should contain a section for v1.0.1 that contains the "initial commit" commit

Actual results:

Here is the contents of the generated CHANGELOG.md:

### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 1.0.1

> 14 July 2020

As you can see, the 1.0.1 section does NOT contain the v prefix, and does not list any commits.

@patlillis
Copy link
Author

@cookpete any thoughts on this issue?

cookpete added a commit that referenced this issue Sep 18, 2020
- Move any tag-specific logic from releases.js to tags.js
- Combine remote and latestVersion into options object to be passed around
- Use const rather than function where possible
- Hopefully fixes various bugs with single tags, including #174
@cookpete
Copy link
Owner

@patlillis Sorry, I attempted to fix this as part of a refactor weeks ago, then forgot about it and didn't push.

I've just published v2.2.1 which I'm hoping will fix this problem. Let me know?

@cawa-93
Copy link

cawa-93 commented Dec 11, 2020

It seems that this is still relevant. I just experimented with my repository template. It has no tags.

After running auto-changelog --latest-version 20.12.11 -l false --unreleased-only -u I received:

### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 20.12.11

While experimenting, I tried to add a v0.0.0 tag to the initializing commit and run the same command again. In this scenario, a completely correct change log was generated, which contained a complete list of all commits.

@rafael-zilberman
Copy link

It seems that this is still relevant. I just experimented with my repository template. It has no tags.

After running auto-changelog --latest-version 20.12.11 -l false --unreleased-only -u I received:

### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 20.12.11

While experimenting, I tried to add a v0.0.0 tag to the initializing commit and run the same command again. In this scenario, a completely correct change log was generated, which contained a complete list of all commits.

Same happens for me, when there is not tags in the repository the generated changelog is empty.
Once I tagged the first commit with v0.0.0 the generated changelog was full with all the commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants