Skip to content

Abbreviate SHA-1 in output to client

Christopher Guindon requested to merge github/fork/spearce/master into master

Created by: spearce

getId().toString() returns an ugly internal JGit string listing the current revision flags attached to the RevCommit. This is not interesting or relevant to the end-user of Gerrit.

Instead abbreviate the SHA-1 to be 8 hex digits and print that as a clean string. For most Git repositories this will be uniquely identified. It is shorter to use in commands like git show when the end-user wants to inspect a commit that was rejected by the CLA plugin.

Merge request reports