Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a6d1941

Browse files
committed
fix(changelog): sort the commits properly to their version
1 parent 5ed9461 commit a6d1941

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

‎CHANGELOG.md‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

2+
## Unreleased
23

4+
### Fix
5+
6+
- **changelog**: sort the commits properly to their version
37

4-
## v1.19.0
8+
## v1.19.0 (2020年05月02日)
59

610
### Fix
711

@@ -13,11 +17,6 @@
1317
- **changelog**: add support for any commit rule system
1418
- **changelog**: add incremental flag
1519

16-
### Refactor
17-
18-
- **changelog**: use functions from changelog.py
19-
- **changelog**: rename category to change_type to fit 'keep a changelog'
20-
2120
## v1.18.3 (2020年04月22日)
2221

2322
### Refactor
@@ -29,6 +28,8 @@
2928
### Refactor
3029

3130
- **git**: replace GitCommit.message code with one-liner
31+
- **changelog**: use functions from changelog.py
32+
- **changelog**: rename category to change_type to fit 'keep a changelog'
3233
- **templates**: rename as "keep_a_changelog_template.j2"
3334
- **templates**: remove unneeded __init__ file
3435
- **cli**: reorder commands
@@ -164,20 +165,20 @@
164165
### Refactor
165166

166167
- **tests/commands/bump**: use tmp_dir to replace self implemented tmp dir behavior
168+
- **git**: make find_git_project_root return None if it's not a git project
169+
- **config/base_config**: make set_key not implemented
170+
- **error_codes**: move all the error_codes to a module
171+
- **config**: replace string type path with pathlib.Path
167172
- **test_bump_command**: rename camel case variables
168173
- **tests/commands/check**: use pytest fixture tmpdir replace self implemented contextmanager
169174
- **test/commands/other**: replace unit test style mock with mocker fixture
170175
- **tests/commands**: separate command unit tests into modules
171176
- **tests/commands**: make commands related tests a module
172-
- **git**: make find_git_project_root return None if it's not a git project
173-
- **config/base_config**: make set_key not implemented
174-
- **error_codes**: move all the error_codes to a module
175-
- **config**: replace string type path with pathlib.Path
176177

177178
### Fix
178179

179-
- **cli**: fix --version not functional
180180
- **git**: remove breakline in the return value of find_git_project_root
181+
- **cli**: fix --version not functional
181182

182183
### Feat
183184

@@ -287,10 +288,10 @@
287288
- **config**: add deprecation warning for loading config from ini files
288289
- **cz/customize**: add jinja support to enhance template flexibility
289290
- **cz/filters**: add required_validator and multiple_line_breaker
290-
- **Commands/commit**: add ́--dry-run ́ flag to the Commit command
291291
- **cz/cz_customize**: implement info to support info and info_path
292292
- **cz/cz_customize**: enable bump_pattern bump_map customization
293293
- **cz/cz_customize**: implement customizable cz
294+
- **Commands/commit**: add ́--dry-run ́ flag to the Commit command
294295
- new 'git-cz' entrypoint
295296

296297
### Refactor
@@ -501,10 +502,6 @@
501502

502503
## v0.9.2 (2017年11月11日)
503504

504-
### Refactor
505-
506-
- **renamed conventional_changelog to conventional_commits, not backward compatible**:
507-
508505
## v0.9.1 (2017年11月11日)
509506

510507
### Fix

‎commitizen/commands/changelog.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __call__(self):
7777
if latest_version:
7878
start_rev = self._find_incremental_rev(latest_version, tags)
7979

80-
commits = git.get_commits(start=start_rev)
80+
commits = git.get_commits(start=start_rev, args="--author-date-order")
8181
if not commits:
8282
out.error("No commits found")
8383
raise SystemExit(NO_COMMITS_FOUND)

‎commitizen/git.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def tag(tag: str):
4646
return c
4747

4848

49-
def commit(message: str, args=""):
49+
def commit(message: str, args: str=""):
5050
f = NamedTemporaryFile("wb", delete=False)
5151
f.write(message.encode("utf-8"))
5252
f.close()
@@ -61,11 +61,12 @@ def get_commits(
6161
*,
6262
log_format: str = "%H%n%s%n%b",
6363
delimiter: str = "----------commit-delimiter----------",
64+
args: str = "",
6465
) -> List[GitCommit]:
6566
"""
6667
Get the commits betweeen start and end
6768
"""
68-
git_log_cmd = f"git log --pretty={log_format}{delimiter}"
69+
git_log_cmd = f"git log --pretty={log_format}{delimiter}{args}"
6970

7071
if start:
7172
c = cmd.run(f"{git_log_cmd} {start}..{end}")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /