Skip to content

Commit 8838577

Browse files
committed
Add pushed commit to push commit message
1 parent 0a2d29e commit 8838577

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/bin/rustc_josh_sync.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_josh_sync::SyncContext;
44
use rustc_josh_sync::config::{JoshConfig, load_config};
55
use rustc_josh_sync::josh::{JoshProxy, try_install_josh};
66
use rustc_josh_sync::sync::{GitSync, RustcPullError, UPSTREAM_REPO};
7-
use rustc_josh_sync::utils::prompt;
7+
use rustc_josh_sync::utils::{get_current_head_sha, prompt};
88
use std::path::{Path, PathBuf};
99

1010
const DEFAULT_CONFIG_PATH: &str = "josh-sync.toml";
@@ -109,18 +109,23 @@ fn main() -> anyhow::Result<()> {
109109
.context("cannot perform push")?;
110110

111111
// Open PR with `subtree update` title to silence the `no-merges` triagebot check
112+
let title = format!("{} subtree update", ctx.config.repo);
113+
let head = get_current_head_sha()?;
114+
112115
let merge_msg = format!(
113-
r#"Subtree update of https://github.com/{}.
116+
r#"Subtree update of `{repo}` to https://github.com/{full_repo}/commit/{head}.
114117
115118
Created using https://github.com/rust-lang/josh-sync.
116119
117120
r? @ghost"#,
118-
ctx.config.full_repo_name(),
121+
repo = ctx.config.repo,
122+
full_repo = ctx.config.full_repo_name(),
119123
);
124+
120125
println!(
121126
r#"You can create the rustc PR using the following URL:
122-
https://github.com/{UPSTREAM_REPO}/compare/{username}:{branch}?quick_pull=1&title={}+subtree+update&body={}"#,
123-
ctx.config.repo,
127+
https://github.com/{UPSTREAM_REPO}/compare/{username}:{branch}?quick_pull=1&title={}&body={}"#,
128+
urlencoding::encode(&title),
124129
urlencoding::encode(&merge_msg)
125130
);
126131
}

0 commit comments

Comments
 (0)