FEATURE: add commit sha when importing commits

FEATURE: add commit sha when importing commits

This makes it way easier to create links and followups

This makes it way easier to create links and followups


diff --git a/lib/discourse_code_review/importer.rb b/lib/discourse_code_review/importer.rb
index d979c24..e43a3e2 100644
--- a/lib/discourse_code_review/importer.rb
+++ b/lib/discourse_code_review/importer.rb
@@ -89,7 +89,9 @@ module DiscourseCodeReview
       body, linked_topics = auto_link_commits(commit[:body])
       linked_topics.merge! find_linked_commits(title)
 
-      raw = "<div class='excerpt'>\n#{body}\n</div>\n\n`‍``diff\n#{diff}\n#{truncated_message}`‍``\n#{link}"
+      short_hash = "<small>sha: #{commit[:hash][0...8]}</small>"
+
+      raw = "<div class='excerpt'>\n#{body}\n</div>\n\n`‍``diff\n#{diff}\n#{truncated_message}`‍``\n#{link} #{short_hash}"
 
       user = ensure_user(
         email: commit[:email],

GitHub

1 Like