Skip to content

Commit

Permalink
Merge pull request #1264 from intuit/next-bug
Browse files Browse the repository at this point in the history
calculate next release notes using the latest fork commit not the first
  • Loading branch information
hipstersmoothie authored May 28, 2020
2 parents 9a3c656 + b5e9aa1 commit 33c3d76
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions packages/core/src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1219,29 +1219,28 @@ export default class Auto {
this.hooks.onCreateLogParse.tap("Omit merges from master", (logParse) => {
logParse.hooks.omitCommit.tap("Omit merges from master", (commit) => {
const shouldOmit = commit.subject.match(/^Merge (?:\S+\/)*master/);
this.logger.verbose.info(
`Omit merges from master?" ${shouldOmit}: ${commit.subject}`
);

if (shouldOmit) {
this.logger.verbose.info(
`Omitting merge commit from master: ${commit.subject}`
);
return true;
}
});
});

const currentBranch = getCurrentBranch();
const initialForkCommit = (
(
await execPromise("git", [
"rev-list",
"--boundary",
`${currentBranch}...origin/${this.baseBranch}`,
"--left-only",
])
)
.split("\n")
.filter((line) => line.startsWith("-"))[0] || ""
).slice(1);
const forkPoints = (
await execPromise("git", [
"rev-list",
"--boundary",
`${currentBranch}...origin/${this.baseBranch}`,
"--left-only",
])
)
.split("\n")
.filter((line) => line.startsWith("-"));
const initialForkCommit = (forkPoints[forkPoints.length - 1] || "").slice(1);
const lastRelease =
initialForkCommit || (await this.git.getLatestRelease());
const lastTag = await this.git.getLastTagNotInBaseBranch(currentBranch!);
Expand Down

0 comments on commit 33c3d76

Please sign in to comment.