Repository navigation
Ability to use git refs migrate --ref-format=reftable - #118
Merged
Merged
Conversation
hannesa2
force-pushed
the
ref-format-reftable
branch
3 times, most recently
from
October 23, 2026 06:18
1f67996 to
1820260
Compare
hannesa2
force-pushed
the
ref-format-reftable
branch
2 times, most recently
from
October 24, 2026 06:08
f238100 to
6f13ed7
Compare
goneng
reviewed
Oct 24, 2026
goneng
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this, @hannesa2 .
I built it with the GitX PR on top and the full GitX suite passes.
The git_object_id_from_buffer switch in GTOID.m looks right (OID type defaults to SHA-1), and
having no git2/deprecated.h imports left is a nice outcome for libgit2#652.
A few "cosmetic" suggestions:
GTRepositoryInitWithoutDotGit = 0:
The new comment says the flag "was already a deprecated no-op".
In libgit2 1.9.7 it was a real bit,(1u << 2), that stopped.gitbeing appended.
In 2.0 it is#define ... 0indeprecated.h, and the behavior is implied whenworkdir_pathis set.
Could you reword the comment?
(A caller that used the flag withoutworkdir_pathnow silently gets different behavior, so
deprecating the enum member (or removing it) may be worth considering.
Nothing in GitX or in this repo uses it.)- Commit order:
The first commit usesgit_object_id_from_buffer, which does not exist in libgit2 1.9.7,
and the libgit2 bump comes second, so the first commit alone does not build.
Swapping the order or squashing them keepsgit bisectusable. -DUSE_GSSAPI:BOOL=OFFinscript/update_libgit2:
this is needed, since rc.1 otherwise finds GSS.framework and enables Negotiate auth.
I suggest saying so in the PR description, because it is not obvious from the diff.- Minor and optional:
git_dataWithOid:andgit_getOid:error:inNSData+Git.musesizeof(git_oid), which
now includes a type byte.
I found no callers, so nothing breaks today.
Apart from these small issues, I think it is safe to merge.
v1.9.x does not recognize extensions.refstorage=reftable at all, so opening a repository that has been migrated with 'git refs migrate --ref-format=reftable' failed with 'unsupported extension name extensions.refstorage' even though the previous commit already adjusted GTOID/GTObject/GTRepository for the newer libgit2 API and added the USE_GSSAPI=OFF build flag. libgit2 only gained a native reftable refdb backend after 1.9, first shipping in the v2.0.0-rc.1 tag, so pin the submodule there instead.
hannesa2
force-pushed
the
ref-format-reftable
branch
from
October 24, 2026 10:41
6f13ed7 to
7006360
Compare
Author
|
I applied your suggestions @goneng |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Bumps the vendored libgit2 submodule to the
v2.0.0-rc.1release candidatetag and adjusts ObjectiveGit for the resulting libgit2 2.0 API changes, so
that repositories migrated with
git refs migrate --ref-format=reftablecanbe opened again.
v1.9.x doesn't recognize
extensions.refstorage=reftableat all, so openingsuch a repository failed with
unsupported extension name extensions.refstorage. libgit2 only gained a native reftable refdb backendafter 1.9, first shipping in
v2.0.0-rc.1, so the submodule is pinned there.Note:
v2.0.0-rc.1is a release candidate, not a final libgit2 2.0release. This PR exists to validate reftable support; it should be revisited
once libgit2 2.0.0 (or a later rc) is tagged.
Changes
External/libgit2: bumped to thev2.0.0-rc.1tag.ObjectiveGit/GTObject.h:GTObjectTypeOffsetDelta/GTObjectTypeRefDeltaare now hardcoded to
6/7. libgit2 2.0 removed these from the publicgit_object_tenum (they're pack-internal delta types, never real ODBobjects); the numeric values are stable per the git pack-format spec.
ObjectiveGit/GTOID.m:OIDByHashingData:type:error:now usesgit_object_id_from_bufferinstead of the deprecatedgit_odb_hash.ObjectiveGit/GTRepository.h:GTRepositoryInitWithoutDotGitis now ahardcoded no-op (
0) and marked deprecated. In libgit2 1.9.7 this was areal bit (
GIT_REPOSITORY_INIT_NO_DOTGIT_DIR,1u << 2) that stopped.gitbeing appended to the init path; libgit2 2.0 dropped the flagentirely, and the same effect is now implied whenever
workdir_pathis seton the init options instead. Nothing in GitX or this repo uses this flag.
script/update_libgit2: added-DUSE_GSSAPI:BOOL=OFFto the CMakeinvocation. Without it, CMake on macOS auto-detects
GSS.framework/system Kerberos and enables GSSAPI/Negotiate HTTP auth support in
v2.0.0-rc.1, which requires linking GSS symbols that the Xcode projectdoesn't link, causing
ld: Undefined symbols ... _gss_*at link time.Disabling GSSAPI avoids that dependency; GitX doesn't use Negotiate auth.
Known limitation
v2.0.0-rc.1vendors libgit2's low-leveldeps/reftablelibrary, butupstream has not yet wired it into an actual refdb backend (no
refdb_reftable.c,extensions.refstoragenot yet in the builtin extensionsallowlist). Opening a reftable-format repository therefore still fails today;
this is tracked upstream as libgit2/libgit2#5352 and will need a newer
libgit2 release once that lands.