GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add sha256 object format support by linsein · Pull Request #140 · gogs/git-module

Conversation

@linsein

@linsein linsein commented Jul 8, 2026

Copy link
Copy Markdown

Describe the pull request

Link to the issue: #138

ObjectFormat struct

  • Add the ObjectFormat struct.
  • Add the *Repository.ObjectFormat method.
  • Add an ObjectFormat member to the InitOption struct

Oid interface

  • Add the Oid interface to represent the Object ID of a Git repository.
  • Add the SHA256 struct.
  • Replace *SHA1 with Oid in other struct fields, method parameters, and return types.
  • Rename the file sha1.go to oid.go.

Add SHA256 Repository testing

  • Add the test_sha256 build tag to control testing variables and constants.
  • Replace hard-coded hashes with the testrepoMarks map.

Others

  • Fix TestReceivePack and TestUploadPack failures occurring on Git client v2.54.0 by updating the string matching patterns.

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

unknwon reacted with heart emoji
All reactions
  • ❤️ 1 reaction
linsein added 2 commits July 8, 2026 11:34
@linsein
Add sha256 object format support
79b8874
@linsein
Add sha256 object format test
9ea7b09
@linsein
linsein requested a review from a team as a code owner July 8, 2026 05:50
@linsein

linsein commented Jul 8, 2026

Copy link
Copy Markdown
Author

Just noticed that the sha256 object format was experimentally supported in Git 2.29 and marked as stable in 2.51.
If using a version of Git earlier than 2.29, users will get error: unknown option 'object-format=sha256'.

Should I give a friendlier error message? Or is it too early to add sha256 support?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unknwon

unknwon commented Jul 16, 2026

Copy link
Copy Markdown
Member

Just noticed that the sha256 object format was experimentally supported in Git 2.29 and marked as stable in 2.51. If using a version of Git earlier than 2.29, users will get error: unknown option 'object-format=sha256'.

Should I give a friendlier error message? Or is it too early to add sha256 support?

no we can just claim v2 requires Git 2.51, no issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unknwon unknwon mentioned this pull request Nov 12, 2026
git, database: support SHA-256 repositories gogs/gogs#8496
Open
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@linsein @unknwon
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.