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

fix(changelog): use root commit when --latest and there is only one tag #59

Merged
merged 9 commits into from
Feb 20, 2022
Merged

fix(changelog): use root commit when --latest and there is only one tag #59

merged 9 commits into from
Feb 20, 2022

Conversation

kenji-miyake
Copy link
Contributor

@kenji-miyake kenji-miyake commented Feb 6, 2022

Description

Changed to use the root commit when the --latest is used and there is only one commit.

Since it uses the improved fixtures test added in #58, it depends on #58.

Motivation and Context

Generally in this case,

git commit --allow-empty -m "Initial commit"

git commit --allow-empty -m "feat: add feature 1"
git tag v0.1.0

I think people expect the following result instead of raising an error.

## [0.1.0] - 2021-01-23

### Features

- Add feature 1

How Has This Been Tested?

Please see .github/fixtures/test-latest-with-one-tag/.

Screenshots / Output (if appropriate):

Please see .github/fixtures/test-latest-with-one-tag/expected.md.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@kenji-miyake kenji-miyake changed the title Use root commit when latest and one tag fix: use root commit when --latest and there is only one tag Feb 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2022

Codecov Report

Merging #59 (4403240) into main (ff1d981) will decrease coverage by 0.30%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
- Coverage   40.73%   40.44%   -0.29%     
==========================================
  Files          13       13              
  Lines         825      831       +6     
  Branches      215      219       +4     
==========================================
  Hits          336      336              
- Misses        380      386       +6     
  Partials      109      109              
Impacted Files Coverage Δ
git-cliff/src/lib.rs 0.69% <0.00%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff1d981...4403240. Read the comment docs.

@orhun
Copy link
Owner

orhun commented Feb 6, 2022

Hey, this sounds good. I'm keeping my eyes on this PR to add review when it's ready 👀

@kenji-miyake
Copy link
Contributor Author

@orhun I'd like to let you know that I've created a setup action for git-cliff.
https://github.com/kenji-miyake/setup-git-cliff

Since you've released binaries, I was able to quickly build the action. Thank you for your work!

I think it can be another option for https://github.com/orhun/git-cliff-action.
Could you give me some comments if you have any feedback? 🙏

@orhun
Copy link
Owner

orhun commented Feb 12, 2022

@orhun I'd like to let you know that I've created a setup action for git-cliff. kenji-miyake/setup-git-cliff

Since you've released binaries, I was able to quickly build the action. Thank you for your work!

Woo that's awesome! Thanks for doing that <3

I think it can be another option for orhun/git-cliff-action. Could you give me some comments if you have any feedback? pray

For sure! Please add it to README.md when it is ready 👍🏼

Sometimes I think I should move all git-cliff related repos to the git-cliff organization. What do you think / are you open to that?

@kenji-miyake kenji-miyake marked this pull request as ready for review February 12, 2022 17:15
@kenji-miyake kenji-miyake requested a review from orhun as a code owner February 12, 2022 17:15
@kenji-miyake
Copy link
Contributor Author

@orhun Rebased and fixed some code, could you review this, please?

Woo that's awesome! Thanks for doing that <3

Thank you, I'll add it after releasing a stable tag!

Sometimes I think I should move all git-cliff related repos to the git-cliff organization. What do you think / are you open to that?

Yes, I think it's a good idea because git-cliff is a great and probably long-running product!
In that case, I will be happy to transfer my setup project there if needed.

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for the late review. This overall looks good but I have a few points that I'd like you to change. GJ 👌🏼

.github/fixtures/test-fixtures-locally.sh Outdated Show resolved Hide resolved
.github/fixtures/test-fixtures-locally.sh Outdated Show resolved Hide resolved
.github/fixtures/test-fixtures-locally.sh Outdated Show resolved Hide resolved
git-cliff/src/lib.rs Outdated Show resolved Hide resolved
git-cliff/src/lib.rs Outdated Show resolved Hide resolved
Kenji Miyake added 7 commits February 20, 2022 11:31
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
@kenji-miyake kenji-miyake requested a review from orhun February 20, 2022 02:51
@kenji-miyake
Copy link
Contributor Author

@orhun Mm... Did you have any ideas about why the test is failed?
It seems the tags() is strange if it's run without --date-order, is this related? 🤔
image

@orhun orhun changed the title fix: use root commit when --latest and there is only one tag fix(changelog): use root commit when --latest and there is only one tag Feb 20, 2022
@orhun
Copy link
Owner

orhun commented Feb 20, 2022

@orhun Mm... Did you have any ideas about why the test is failed? It seems the tags() is strange if it's run without --date-order, is this related?

git_log test is being run against the latest commit in the repository and it is basically checking if it is conventional or not. It was a self-perpetuating mechanism that I created for preventing unconventional commits making into the repository. And unfortunately, your last commit wasn't conventional so it fails :D

However, I pushed some conventional commits (2ad4e51 & 4403240) and now it's fixed 🎉

@orhun orhun merged commit 3ccec7f into orhun:main Feb 20, 2022
@kenji-miyake kenji-miyake deleted the use-root-commit-when-latest-and-one-tag branch February 20, 2022 20:12
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

Successfully merging this pull request may close these issues.

3 participants