If I query the bitbucket api for commits, I get the long version:
bitbucket_curl(){
curl -H 'Authorization:Basic YW1JyKg==' "https://api.bitbucket.org$@"
}
commits="$(bitbucket_curl '/2.0/repositories/interos/datavana/commits/alex/dockerize?pagelen=3')"
latest_commit="$(echo "$commits" | jq -r '.values[0].hash')"
given a long commit: c56cefbd0c81142558cf814cba7d7cd75d7cb6a7
is there a way to reliably get the short commit hash? Isn't it like the last 10 chars or something? Or perhaps there is a way to request the short hash from the Bitbucket API? On that subject I am looking for a reliable way to get the most recent commit for a branch.