-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Put newest commit on top in CHANGELOG.md #15
Conversation
Previously, cliff was sorting the commits by oldest first. Like: ``` - Support parsing the missing scopes with `default_scope` (orhun#8) - Support generating a changelog scoped to a directory (orhun#11) ``` As the PR numbers indicate, the first bullet point is definitely older than the latter. With this update, it will look like this: ``` - Support generating a changelog scoped to a directory (orhun#11) - Support parsing the missing scopes with `default_scope` (orhun#8) ``` Signed-off-by: Taylan Dogan <git@taylandogan.info>
Codecov Report
@@ Coverage Diff @@
## main #15 +/- ##
==========================================
+ Coverage 41.87% 41.92% +0.06%
==========================================
Files 13 13
Lines 633 637 +4
Branches 168 169 +1
==========================================
+ Hits 265 267 +2
Misses 276 276
- Partials 92 94 +2
Continue to review full report at Codecov.
|
I think it'd be better to have a flag to make the sorting optional :) |
Alright, sounds good to me. Do you have anything in mind? The first thing comes to my mind is something similar to this. pub struct Opt {
...
pub sort: Option<Sort>,
}
#[derive(StructOpt, Debug)]
pub enum Sort {
Newest,
Oldest,
} WDYT? |
Looks good to me. And obviously |
I don't expect any other sorting types will be added so the logic consist of checking whether it is `newest` or not. One could argue with why wouldn't I make this a boolean. My answer would be, in my opinion, it lose its meaning because this is not something we want to enable or disable but something that we want to decide which pattern we want to use. So it is more like a semantic choice. Signed-off-by: Taylan Dogan <git@taylandogan.info>
Well, I decided to use a simple string. My reasoning is:
So what do you think about these new changes? @orhun |
Looks good to me! Only one thing, I moved the explanation of this flag to README.md in a0635ee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥂
Description
Change the way
git-cliff
sorts commit messages on CHANGELOG.md.Motivation and Context
Normally, I would expect the latest change on the top in CHANGELOG. However, currently,
git-cliff
puts the oldest commit on the top of the sections(#Features, Fixes and such).How Has This Been Tested?
I tested this using both a mock repo and
git-cliff
's own repo.Screenshots / Output (if appropriate):
With this update, it will look like this:
Types of changes
Checklist: