File tree 1 file changed +8
-2
lines changed
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
@@ -52,7 +54,11 @@ pub async fn unroll_rollup(
52
54
let commit = c
53
55
. sha
54
56
. as_deref ( )
55
- . map ( |s| format_commit ( s, false ) )
57
+ . map ( |s| {
58
+ // Format the SHA as a code block to make it easy to copy-paste verbatim
59
+ let link = commit_link ( s) ;
60
+ format ! ( "`{s}` ([link]({link}))" )
61
+ } )
56
62
. unwrap_or_else ( || {
57
63
let head = format_commit ( & c. rolled_up_head , true ) ;
58
64
format ! ( "❌ conflicts merging '{head}' into previous master ❌" )
You can’t perform that action at this time.
0 commit comments