chore(common): remove --first-parent when searching for PRs

Instead of just reporting on --first-parent, now lists all merges that
are in the log, which means we get some non-PR merges but that's ok. At
least we get all of them.

This was most visible with chained PRs which were merged bottom-up.
This commit is contained in:
Marc Durdin 2020-11-26 09:49:21 +11:00
parent 51c69e2894
commit fb36fc3f69

View file

@ -120,7 +120,7 @@ const splicePullsIntoHistory = async (pulls: PRInformation[]): Promise<number> =
if(match) {
state = gt(match[1], version) ? "newer" : "older";
}
}
}
historyChunks[state].push(line);
}
@ -149,7 +149,7 @@ const splicePullsIntoHistory = async (pulls: PRInformation[]): Promise<number> =
const pullNumberRe = new RegExp(`#${pull.number}\\b`);
if(pull.title.match(/^auto/)) {
// We always skip pull requests that are
// We always skip pull requests that are
// automatically generated. At time this is written,
// that only includes incrementing version. But in
// future there may be others.
@ -201,10 +201,10 @@ const splicePullsIntoHistory = async (pulls: PRInformation[]): Promise<number> =
}
/**
* Adds any outstanding pull request titles to HISTORY.md for the current
* Adds any outstanding pull request titles to HISTORY.md for the current
* version. Retrieves pull request details from GitHub.
* @returns number of history entries for the current version,
* 0 if no pulls associated with the current vesrion, or
* @returns number of history entries for the current version,
* 0 if no pulls associated with the current vesrion, or
* -1 on error.
*/
@ -225,8 +225,8 @@ export const fixupHistory = async (
//
// Now, use git log to retrieve list of merge commit refs since then
//
const git_result = (await spawnChild('git', ['log', '--merges', '--first-parent', '--format=%H', base, `${commit_id}..`])).trim();
const git_result = (await spawnChild('git', ['log', '--merges', /*'--first-parent',*/ '--format=%H', base, `${commit_id}..`])).trim();
if(git_result.length == 0) {
// We won't throw on this
logWarning('No pull requests found since previous increment');
@ -259,5 +259,5 @@ export const fixupHistory = async (
const changeCount = await splicePullsIntoHistory(pulls);
return changeCount;
return changeCount;
};