Patch version taking the number of commits #79
Unanswered
jeba-schulz-epam
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Perhaps you have This test indicates the expected behavior, and runs correctly for me: test('Patch increments only once', async () => {
const repo = createTestRepo({ tagPrefix: '', versionFormat: "${major}.${minor}.${patch}" });
repo.makeCommit('Initial Commit');
repo.exec('git tag 0.0.1');
const firstResult = await repo.runAction();
repo.makeCommit('Second Commit');
const secondResult = await repo.runAction();
repo.makeCommit('Third Commit');
const thirdResult = await repo.runAction();
repo.makeCommit('fourth Commit');
const fourthResult = await repo.runAction();
expect(firstResult.formattedVersion).toBe('0.0.1');
expect(secondResult.formattedVersion).toBe('0.0.2');
expect(thirdResult.formattedVersion).toBe('0.0.2');
expect(fourthResult.formattedVersion).toBe('0.0.2');
}, 15000); Contrast that behavior with bump each commit enabled, which does show the behavior you describe. test('Patch increments each time when bump each commit is set', async () => {
const repo = createTestRepo({ tagPrefix: '', versionFormat: "${major}.${minor}.${patch}", bumpEachCommit: true });
repo.makeCommit('Initial Commit');
repo.exec('git tag 0.0.1');
const firstResult = await repo.runAction();
repo.makeCommit('Second Commit');
const secondResult = await repo.runAction();
repo.makeCommit('Third Commit');
const thirdResult = await repo.runAction();
repo.makeCommit('fourth Commit');
const fourthResult = await repo.runAction();
expect(firstResult.formattedVersion).toBe('0.0.1');
expect(secondResult.formattedVersion).toBe('0.0.2');
expect(thirdResult.formattedVersion).toBe('0.0.3');
expect(fourthResult.formattedVersion).toBe('0.0.4');
}, 15000); There has been some discussion already here about supporting a patch_pattern type parameter specifically for when bump_each_commit is used but you don't want to increment unless a pattern is found. Maybe this can go into v5.1.0. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @PaulHatch
I have gone through the entire documentation, as per your information If it isn't a major or minor release, it will be a "patch" type by default.
But when i run with version_format: "${major}.${minor}.${patch}" patch is still taking the total number of commits even in the first run.
I don't see patch is being incremented normally like major and minor. can you please help here
also can you please add patch_pattern : "fix:" something like this so that patch can be incremented with the keyword similar to minor and major versions?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions