packages/tools/git-changelog.js
// The first "relevant tag" is the one that exists, and from which there are changes.
The first "relevant tag" is the one that exists, and from which there are changes.
The first " relevant tag " is the one that exists and from which there are changes .
async function findFirstRelevantTag(baseTag, platform, allTags) {
	let baseTagIndex = allTags.indexOf(baseTag);
	if (baseTagIndex < 0) baseTagIndex = allTags.length;
	for (let i = baseTagIndex - 1; i >= 0; i--) {
		const tag = allTags[i];
		if (platformFromTag(tag) !== platform) continue;
		try {
			const logs = await gitLog(tag);
			const filteredLogs = filterLogs(logs, platform);
			if (filteredLogs.length) return tag;
		} catch (error) {
			if (error.message.indexOf('unknown revision') >= 0) {
			} else {
				throw error;
			}
		}
	}
	throw new Error(`Could not find previous tag for: ${baseTag}`);
}
async function findFirstRelevantTag ( baseTag , platform , allTags ) { let baseTagIndex = allTags . indexOf ( baseTag ) ; if ( baseTagIndex < 0 ) baseTagIndex = allTags . length ; for ( let i = baseTagIndex - 1 ; i >= 0 ; i -- ) { const tag = allTags [ i ] ; if ( platformFromTag ( tag ) !== platform ) continue ; try { const logs = await gitLog ( tag ) ; const filteredLogs = filterLogs ( logs , platform ) ; if ( filteredLogs . length ) return tag ; } catch ( error ) { if ( error . message . indexOf ( 'unknown revision' ) >= 0 ) { } else { throw error ; } } } throw new Error ( ` ${ baseTag } ` ) ; }
The first "relevant tag" is the one that exists, and from which there are changes.
The first " relevant tag " is the one that exists and from which there are changes .
// We skip the error - it means this particular tag has never been created