File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,11 @@ pub async fn unroll_rollup(
29
29
previous_master : & str ,
30
30
rollup_pr_number : u32 ,
31
31
) -> Result < ( ) , String > {
32
+ let commit_link = |sha : & str | format ! ( "https://github.com/rust-lang-ci/rust/commit/{sha}" ) ;
33
+
32
34
let format_commit = |s : & str , truncate : bool | {
33
35
let display = truncate. then ( || s. split_at ( 10 ) . 0 ) . unwrap_or ( s) ;
34
- format ! ( "[{display}](https://github.com/rust-lang-ci/rust/commit/{s })" )
36
+ format ! ( "[{display}]({ })" , commit_link ( s ) )
35
37
} ;
36
38
37
39
// Sort rolled up commits by their PR number in ascending order, so that they have the
@@ -49,7 +51,11 @@ pub async fn unroll_rollup(
49
51
let commit = c
50
52
. sha
51
53
. as_deref ( )
52
- . map ( |s| format_commit ( s, false ) )
54
+ . map ( |s| {
55
+ // Format the SHA as a code block to make it easy to copy-paste verbatim
56
+ let link = commit_link ( s) ;
57
+ format ! ( "`{s}` ([link]({link}))" )
58
+ } )
53
59
. unwrap_or_else ( || {
54
60
let head = format_commit ( & c. rolled_up_head , true ) ;
55
61
format ! ( "❌ conflicts merging '{head}' into previous master ❌" )
You can’t perform that action at this time.
0 commit comments