@@ -121,25 +121,32 @@ let populate_issue repository (issue : issue) =
121
121
let populate_commit repository (commit : api_commit ) =
122
122
let ({ sha; commit; url; author; files; _ } : api_commit ) = commit in
123
123
let title =
124
- sprintf " `<%s|%s>` *%s - %s *" url (Slack. git_short_sha_hash sha)
124
+ sprintf " `<%s|%s>` *%s - <%s|%s> *" url (Slack. git_short_sha_hash sha)
125
125
(escape_mrkdwn @@ first_line commit.message)
126
+ (escape_mrkdwn author.html_url)
126
127
(escape_mrkdwn commit.author.name)
127
128
in
128
- let num_change = List. length files in
129
- let prefix_path =
130
- List. map files ~f: (fun f -> f.filename)
131
- |> Common. longest_common_prefix
132
- |> String. split ~on: '/'
133
- |> List. drop_last_exn
134
- |> String. concat ~sep: " /"
129
+ let changes =
130
+ match files with
131
+ | [f] -> sprintf " _modified `%s` (+%d-%d)_" (escape_mrkdwn f.filename) f.additions f.deletions
132
+ | _ ->
133
+ let prefix_path =
134
+ List. map files ~f: (fun f -> f.filename)
135
+ |> Common. longest_common_prefix
136
+ |> String. split ~on: '/'
137
+ |> List. drop_last_exn
138
+ |> String. concat ~sep: " /"
139
+ in
140
+ sprintf " modified %d files in `%s/`" (List. length files) prefix_path
135
141
in
136
- let changes = sprintf " %d changed %s in `%s/`" num_change (Slack. pluralize " file" num_change " s" ) prefix_path in
137
142
let text = sprintf " %s\n %s" title changes in
138
143
let fallback = sprintf " [%s] %s - %s" (Slack. git_short_sha_hash sha) commit.message commit.author.name in
139
144
{
140
145
(base_attachment repository) with
146
+ (*
141
147
author_name = Some author.login;
142
148
author_link = Some author.html_url;
149
+ *)
143
150
author_icon = Some author.avatar_url;
144
151
color = Some Colors. gray;
145
152
mrkdwn_in = Some [ " text" ];
0 commit comments