Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Reftable backend current version #1215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hanwen
Copy link
Contributor

@hanwen hanwen commented Feb 8, 2022

In https://lore.kernel.org/git/220203.867dab6dmp.gmgdl@evledraar.gmail.com/ Ævar considered the option of merging the reftable without 100% of tests passing. In my development branch, I am down to 26 test failures.

As input to this discussion, I'm proffering the latest version of the reftable support.

@gitgitgadget-git
Copy link

There are issues in commit ff80a24:
refs: RFC: Reftable support for git-core
Lines in the body of the commit messages should be wrapped between 60 and 76 characters.

@gitgitgadget-git
Copy link

There are issues in commit c6ec2d9:
refs: RFC: Reftable support for git-core
Lines in the body of the commit messages should be wrapped between 60 and 76 characters.

@hanwen hanwen force-pushed the reftable-rfc branch 2 times, most recently from 021c78b to d9bba41 Compare February 8, 2022 20:11
@gitgitgadget-git
Copy link

There are issues in commit d9bba41:
refs: RFC: Reftable support for git-core
Lines in the body of the commit messages should be wrapped between 60 and 76 characters.

@hanwen
Copy link
Contributor Author

hanwen commented Feb 8, 2022

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1215.git.git.1644351400761.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1215/hanwen/reftable-rfc-v1

To fetch this version to local tag pr-git-1215/hanwen/reftable-rfc-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1215/hanwen/reftable-rfc-v1

@hanwen hanwen changed the base branch from seen to master September 12, 2022 10:41
@hanwen hanwen force-pushed the reftable-rfc branch 4 times, most recently from 46ed454 to 17d751e Compare October 25, 2022 12:07
@hanwen
Copy link
Contributor Author

hanwen commented Nov 28, 2022

# on 2022-10-24T19:07:00+02:00, elapsed 9m1.652261737s:
t0002-gitfile.sh     - error: # failed 2 among 14 test(s)                           
t0033-debug.sh       - error: # failed 3 among 6 test(s)                            
t0410-partial-clone.sh - error: # failed 2 among 33 test(s)                           
t1092-sparse-checkout-compatibility.sh - error: # failed 1 among remaining 79 test(s)                 
t1301-shared-repo.sh - error: # failed 1 among 22 test(s)                           
t1302-repo-version.sh - error: # failed 1 among 18 test(s)                           
t1400-update-ref.sh  - error: # failed 51 among 191 test(s)                         
t1401-symbolic-ref.sh - error: # failed 2 among 21 test(s)                           
t1404-update-ref-errors.sh - error: # failed 21 among 53 test(s)                          
t1406-submodule-ref-store.sh - error: # failed 6 among 15 test(s)                           
t1410-reflog.sh      - error: # failed 12 among remaining 26 test(s)                
t1415-worktree-refs.sh - error: # failed 2 among 11 test(s)                           
t1417-reflog-updateref.sh - error: # failed 1 among 21 test(s)                           
t1420-lost-found.sh  - error: # failed 1 among 2 test(s)                            
t1430-bad-ref-name.sh - error: # failed 5 among remaining 40 test(s)                 
t2011-checkout-invalid-head.sh - error: # failed 1 among 10 test(s)                           
t2400-worktree-add.sh - error: # failed 3 among 72 test(s)                           
t2407-worktree-heads.sh - error: # failed 2 among 12 test(s)                           
t3200-branch.sh      - error: # failed 27 among 156 test(s)                         
t3306-notes-prune.sh - error: # failed 5 among 12 test(s)                           
t3310-notes-merge-manual-resolve.sh - error: # failed 1 among 22 test(s)                           
t3403-rebase-skip.sh - error: # failed 6 among 20 test(s)                           
t3404-rebase-interactive.sh - error: # failed 4 among 124 test(s)                          
t3407-rebase-abort.sh - error: # failed 2 among 15 test(s)                           
t3504-cherry-pick-rerere.sh - error: # failed 3 among 9 test(s)                            
t3507-cherry-pick-conflict.sh - error: # failed 9 among 44 test(s)                           
t3510-cherry-pick-sequence.sh - error: # failed 13 among remaining 49 test(s)                
t4013-diff-various.sh - error: # failed 7 among 212 test(s)                          
t4202-log.sh         - error: # failed 8 among 143 test(s)                          
t4301-merge-tree-write-tree.sh - error: # failed 3 among 25 test(s)                           
t5304-prune.sh       - error: # failed 2 among 29 test(s)                           
t5312-prune-corruption.sh - error: # failed 4 among 14 test(s)                           
t5318-commit-graph.sh - error: # failed 2 among 97 test(s)                           
t5319-multi-pack-index.sh - error: # failed 1 among 78 test(s)                           
t5329-pack-objects-cruft.sh - error: # failed 4 among 30 test(s)                           
t5510-fetch.sh       - error: # failed 1 among 183 test(s)                          
t5537-fetch-shallow.sh - error: # failed 1 among 16 test(s)                           
t5541-http-push-smart.sh - error: # failed 3 among 43 test(s)                           
t5551-http-fetch-smart.sh - error: # failed 1 among 45 test(s)                           
t5601-clone.sh       - error: # failed 1 among 109 test(s)                          
t5605-clone-local.sh - error: # failed 1 among 22 test(s)                           
t5702-protocol-v2.sh - error: # failed 5 among 70 test(s)                           
t5801-remote-helpers.sh - error: # failed 4 among remaining 30 test(s)                 
t6020-bundle-misc.sh - error: # failed 4 among 16 test(s)                           
t6030-bisect-porcelain.sh - error: # failed 45 among 84 test(s)                          
t6050-replace.sh     - error: # failed 1 among 37 test(s)                           
t6120-describe.sh    - error: # failed 2 among 86 test(s)                           
t6300-for-each-ref.sh - error: # failed 4 among 326 test(s)                          
t6301-for-each-ref-errors.sh - error:                                                       
t7509-commit-authorship.sh - error: # failed 2 among 12 test(s)                           
t7512-status-help.sh - error: # failed 19 among 44 test(s)                          
t7700-repack.sh      - error: # failed 2 among 31 test(s)                           
t9350-fast-export.sh - error: # failed 4 among remaining 50 test(s)                 
t9903-bash-prompt.sh - error: # failed 51 among 67 test(s)                          

hanwen and others added 3 commits July 20, 2023 18:05
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
For background, see Documentation/technical/reftable.txt.

This introduces the file refs/reftable-backend.c containing a
reftable-powered ref storage backend.

It can be activated by setting GIT_TEST_REFTABLE in the environment.
When GIT_TEST_REFTABLE is set, the test prerequisite !REFFILES is set.

There is no option to git-init for now, as the test suite still shows
failures with GIT_TEST_REFTABLE=1.

Example use: see t/t0031-reftable.sh

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Junio Hamano <gitster@pobox.com>
Helped-by: Patrick Steinhardt <patrick.steinhardt@elego.de>
Co-authored-by: Jeff King <peff@peff.net>
Documentation/glossary.txt defines precisely what pseudorefs are, but
does not define their syntax. Previous code suggests that they are all
uppercase at toplevel, but this is not true:

* HEAD is not a pseudo ref.

* various tests create symrefs called "FOO"

* refs under rebase-apply/ and rebase-merge/ are assumed to be in the
  filesystem (so pending rebases can be aborted by deleting the tree
  under .git/rebase-{apply,merge/).

Instead of trying to use a generic definition, setup a hardcoded list
of known pseudo-refs.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 19, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler the
code, because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update
the code such that all writes by default go to reftable directly. Then
the result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races) relative to an
implementation that disregards loose refs. Or,  JGit could be adapted
to follow this implementation.

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable/

on the other hand, the code is already there, and it's well-structured
and well-tested.

This implementation is a prototype. To test, you need to do `export
GIT_TEST_REFTABLE=1`. Doing so creates a handful of errors in the
test-suite, most seemingly related to the new behavior of pack-refs
(which creates a reftable/ dir and not a packed-refs file.), but it
seems overseeable.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 19, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler the
code, because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update
the code such that all writes by default go to reftable directly. Then
the result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races) relative to an
implementation that disregards loose refs. Or,  JGit could be adapted
to follow this implementation.

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable/

on the other hand, the code is already there, and it's well-structured
and well-tested.

refs/reftable-backend.c was created by cannibalizing the first version
of reftable support (github PR 1215 as mentioned above). It supports
reflogs and symrefs, even though those are never exercised.

This implementation is a prototype, for the following reasons:

- no considerations of backward compatibility and configuring an
extension
- no support for converting between packed-refs and reftable
- no documentation
- test failures when setting GIT_TEST_REFTABLE=1.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 19, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler the
code, because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update
the code such that all writes by default go to reftable directly. Then
the result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races) relative to an
implementation that disregards loose refs. Or,  JGit could be adapted
to follow this implementation.

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable/

on the other hand, the code is already there, and it's well-structured
and well-tested.

refs/reftable-backend.c was created by cannibalizing the first version
of reftable support (github PR 1215 as mentioned above). It supports
reflogs and symrefs, even though those are never exercised.

This implementation is a prototype, for the following reasons:

- no considerations of backward compatibility and configuring an
extension
- no support for converting between packed-refs and reftable
- no documentation
- test failures when setting GIT_TEST_REFTABLE=1.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 19, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler the
code, because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update
the code such that all writes by default go to reftable directly. Then
the result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races) relative to an
implementation that disregards loose refs. Or,  JGit could be adapted
to follow this implementation.

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable/

on the other hand, the code is already there, and it's well-structured
and well-tested.

refs/reftable-backend.c was created by cannibalizing the first version
of reftable support (github PR 1215 as mentioned above). It supports
reflogs and symrefs, even though those are never exercised.

This implementation is a prototype, for the following reasons:

- no considerations of backward compatibility and configuring an
extension
- no support for converting between packed-refs and reftable
- no documentation
- test failures when setting GIT_TEST_REFTABLE=1.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 20, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler the
code, because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update
the code such that all writes by default go to reftable directly. Then
the result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races) relative to an
implementation that disregards loose refs. Or,  JGit could be adapted
to follow this implementation.

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable/

on the other hand, the code is already there, and it's well-structured
and well-tested.

refs/reftable-backend.c was created by cannibalizing the first version
of reftable support (github PR 1215 as mentioned above). It supports
reflogs and symrefs, even though those are never exercised.

This implementation is a prototype, for the following reasons:

- no considerations of backward compatibility and configuring an
extension
- no support for converting between packed-refs and reftable
- no documentation
- test failures when setting GIT_TEST_REFTABLE=1.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
hanwen added a commit to hanwen/git that referenced this pull request Sep 20, 2023
This introduces the reftable backend as an alternative to the packed
backend.

This is an alternative to the approach which was explored in
git#1215. This alternative is simpler,
because we now longer have to worry about:

- pseudorefs and the HEAD ref
- worktrees
- commands that blur together files and references (cherry-pick, rebase)

This deviates from the spec that in
Documentation/technical/reftable.txt. It might be possible to update the
code such that all writes by default go to reftable directly. Then the
result would be compatible with an implementation that writes only
reftable (the reftable lock would still prevent races), but something
must be done about the HEAD ref (which JGit keeps in reftable too.)
Alternatively, JGit could be adapted to follow this implementation:
despite the code being there for 4 years now, I haven't heard of anyone
using it in production (exactly because CGit does not support it).

For this incremental path, the reftable format is arguably more
complex than necessary, as

- packed-refs doesn't support symrefs
- reflogs aren't moved into reftable

on the other hand, the code is already there, and it's well-structured
and well-tested.

refs/reftable-backend.c was created by cannibalizing the first version
of reftable support (github PR 1215 as mentioned above). It supports
reflogs and symrefs, even though those features are never exercised.

This implementation is a prototype, for the following reasons:

- no considerations of backward compatibility and configuring an
extension
- no support for converting between packed-refs and reftable
- no documentation
- test failures when setting GIT_TEST_REFTABLE=1.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant