Skip to content

Support SHA-256 git hashes in reference checks - #253

Open
James Frost (jfrost-mo) wants to merge 1 commit into
MetOffice:mainfrom
jfrost-mo:sha256support
Open

Support SHA-256 git hashes in reference checks#253
James Frost (jfrost-mo) wants to merge 1 commit into
MetOffice:mainfrom
jfrost-mo:sha256support

Conversation

@jfrost-mo

@jfrost-mo James Frost (jfrost-mo) commented Sep 4, 2026

Copy link
Copy Markdown
Member

PR Summary

Git 3.0 will be defaulting to SHA-256, so will have longer (64 character) object IDs.

This PR has not exhaustively reviewed support for SHA-256, only fixed an issue I spotted when making another change, and a couple others I found by grepping for the {40} regex pattern.

Sci/Tech Reviewer:
Code Reviewer:

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (please describe)

I have successfully cloned a SHA-256 repository (hosted on a local webserver) with this script. Both hashes and branches as refs worked, though hashes required hacking clone_repo as directly fetching a commit is not supported by the dumb HTTP transport. This would not be an issue on a proper git host.

I have also verified that existing checks for SHA-1 hashes remain working.

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

@jfrost-mo
James Frost (jfrost-mo) marked this pull request as ready for review September 4, 2026 15:55
Git 3.0 will be defaulting to SHA-256, so will have longer (64
character) object IDs.

This is a non-exhaustive fix, as I have not checked everywhere in the
codebase, but just grepped for some common regex patterns that would be
problematic. I have checked that you can checkout a SHA-256 format
repository though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants