Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

sandyarmstrong
Copy link
Member

Upstream git is actively working on extensions that should be treated as known, even if they are currently experimental, as they do not break these targets.

objectFormat and compatObjectFormat are used to support SHA256 hashes: https://git-scm.com/docs/hash-function-transition

refStorage is used to support the new reftable binary storage backend: https://git-scm.com/docs/reftable

These extensions offer performance and security benefits, and we should expect to see more users trying them out before they become the default in git 3.0.

See https://about.gitlab.com/blog/what-s-new-in-git-2-51-0/#planning-towards-git-30 for details about what may be coming in git 3.0.

Fixes #1097.

Upstream git is actively working on extensions that should be
treated as known, even if they are currently experimental, as they do
not break these targets.

`objectFormat` and `compatObjectFormat` are used to support
SHA256 hashes: https://git-scm.com/docs/hash-function-transition

`refStorage` is used to support the new `reftable` binary storage
backend: https://git-scm.com/docs/reftable

These extensions offer performance and security benefits, and we
should expect to see more users trying them out before they
become the default in git 3.0.

See https://about.gitlab.com/blog/what-s-new-in-git-2-51-0/#planning-towards-git-30
for details about what may be coming in git 3.0.
@tmat
Copy link
Member

tmat commented Sep 3, 2025

With SHA256 enabled, couldn't references now contain SHA256 instead of SHA1, which would result in an exception thrown when we read these?

@sandyarmstrong
Copy link
Member Author

sandyarmstrong commented Sep 3, 2025

With SHA256 enabled, couldn't references now contain SHA256 instead of SHA1, which would result in an exception thrown when we read these?

I thought the target just reads them as strings?

@philipp-naused
Copy link

Could you add relativeWorktrees as well?
https://git-scm.com/docs/git-config#Documentation/git-config.txt-relativeWorktrees
For #1468

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some code changes are needed to handle the new file formats:

E.g.
https://github.com/dotnet/sourcelink/blob/main/src/Microsoft.Build.Tasks.Git/GitDataReader/GitReferenceResolver.cs#L258

We also need tests for each of these.

@sandyarmstrong
Copy link
Member Author

For the reftable format, we might ideally want a libgit2sharp that understands how to work directly with that backend. Looks like libgit2 folks are currently working on that: libgit2/libgit2#7117.

@sandyarmstrong
Copy link
Member Author

sandyarmstrong commented Sep 3, 2025

For objectFormat (to support SHA256 hashes), even after bumping to the latest libgit2sharp, I see that branch rename in the integration tests fails due to LibGit2Sharp.LibGit2SharpException : unsupported extension name extensions.compatobjectformat.

But libgit2/libgit2#6191 explains that not supporting compatobjectformat is intentional, and makes the assertion that git itself does not yet support that either. I'll need to do some research to see if that is true. However, I have verified that if you run git init --object-format sha256 in git 2.51, it only sets objectformat (and repositoryformatversion), not compatobjectformat.

compatobjectformat aside, there are still errors as described in libgit2/libgit2sharp#2153.

@tmat
Copy link
Member

tmat commented Sep 3, 2025

For the reftable format, we might ideally want a libgit2sharp that understands how to work directly with that backend. Looks like libgit2 folks are currently working on that: libgit2/libgit2#7117.

We only use libgit2sharp for end-to-end testing. Source Link has its own git data reader.

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.

.Net 8 Build fails when inside a particular git repository
3 participants