xtask/git/reduce/
core_ver.rs

1use anyhow::Result;
2use clap::Args;
3
4use crate::util::get_commit_for_core_version;
5
6/// Reduce the difference of the versions of `swc_core`s to the list of commits
7/// and pull requests.
8#[derive(Debug, Args)]
9pub(super) struct CoreVerCmd {
10    from: String,
11
12    to: String,
13}
14
15impl CoreVerCmd {
16    pub fn run(self) -> Result<()> {
17        let from_commit = get_commit_for_core_version(&self.from, false)?;
18        let to_commit = get_commit_for_core_version(&self.to, true)?;
19
20        eprintln!(
21            "GitHub diff: https://github.com/swc-project/swc/compare/{from_commit}...{to_commit}"
22        );
23
24        Ok(())
25    }
26}