```ruby
class ShortCommitSerializer < ActiveModel::Serializer
  attributes :sha, :message
end
```

Improve commit message formatting in API responses
user
```ruby
class ShortCommitSerializer < ActiveModel::Serializer
  attributes :sha, :message

  def message
    object.pull_request? ? "#{object.pull_request_title} (##{object.pull_request_id})" : object.message
  end
end
```
assistant