git_interface: Force-move Change-Id to end of commit message

Sometimes the git commit hook inserts the Change-Id into the middle of
the commit message and not to its last paragraph. This seems to happen
if '---' is part of the commit message. Subsequently gerrit refuses to
accept the commit.

Solve the problem by force-moving the Change-Id to the end of the commit
message.

While at it, drop get_last_commit_sha_linux_chrome() and its use - we
can refer to the most recent commit in a branch by using the 'HEAD'
reference, without knowing the actual SHA.

BUG=None
TEST=Run patch robot

Change-Id: I68cfe434753d20cdf1f00929b8f1e2ff490b76b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2254304
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
1 file changed