Skip to content

Create a reference backend for packed refs

Michael Haggerty git 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest30 patches 3 repliesIn review
  2. v229 patches 22 repliesSuperseded
  3. v128 patches 23 repliesSuperseded

Changes in v3 from the cover letter

* Delete some debugging cat commands in t1408.

* Add some tests of reading packed-refs files with bogus contents.

* When reporting corruption in packed-refs files, distinguish between unterminated lines and other corruption.

* Fixed a typo in a commit message.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30t1408: add a test of stale packed refs covered by loose refst/t1408-packed-refs.sh+42 -00 replies
2/30add_packed_ref(): teach function to overwrite existing refsrefs/files-backend.c+18 -220 replies
3/30packed_ref_store: new structrefs/files-backend.c+33 -90 replies
4/30packed_ref_store: move `packed_refs_path` hererefs/files-backend.c+12 -130 replies
5/30packed_ref_store: move `packed_refs_lock` member hererefs/files-backend.c+16 -150 replies
6/30clear_packed_ref_cache(): take a `packed_ref_store *` parameterrefs/files-backend.c+8 -80 replies
7/30validate_packed_ref_cache(): take a `packed_ref_store *` parameterrefs/files-backend.c+6 -70 replies
8/30get_packed_ref_cache(): take a `packed_ref_store *` parameterrefs/files-backend.c+12 -140 replies
9/30get_packed_refs(): take a `packed_ref_store *` parameterrefs/files-backend.c+5 -50 replies
10/30add_packed_ref(): take a `packed_ref_store *` parameterrefs/files-backend.c+5 -50 replies
11/30lock_packed_refs(): take a `packed_ref_store *` parameterrefs/files-backend.c+22 -90 replies
12/30commit_packed_refs(): take a `packed_ref_store *` parameterrefs/files-backend.c+9 -90 replies
13/30rollback_packed_refs(): take a `packed_ref_store *` parameterrefs/files-backend.c+7 -80 replies
14/30get_packed_ref(): take a `packed_ref_store *` parameterrefs/files-backend.c+7 -50 replies
15/30repack_without_refs(): take a `packed_ref_store *` parameterrefs/files-backend.c+10 -100 replies
16/30packed_peel_ref(): new function, extracted from `files_peel_ref()`refs/files-backend.c+15 -110 replies
17/30packed_ref_store: support iterationrefs/files-backend.c+110 -90 replies
18/30packed_read_raw_ref(): new function, replacing `resolve_packed_ref()`refs/files-backend.c+17 -190 replies
19/30packed-backend: new module for handling packed referencesMakefile refs.c refs/files-backend.c +3 more+686 -6390 replies
20/30packed_ref_store: make class into a subclass of `ref_store`refs/files-backend.c refs/packed-backend.c refs/packed-backend.h +1 more+226 -450 replies
21/30commit_packed_refs(): report errors rather than dyingrefs/files-backend.c refs/packed-backend.c refs/packed-backend.h+61 -360 replies
22/30commit_packed_refs(): use a staging file separate from the lockfilerefs/packed-backend.c+32 -80 replies
23/30packed_refs_lock(): function renamed from lock_packed_refs()refs/files-backend.c refs/packed-backend.c refs/packed-backend.h+8 -80 replies
24/30packed_refs_lock(): report errors via a `struct strbuf *err`refs/files-backend.c refs/packed-backend.c refs/packed-backend.h+16 -130 replies
25/30packed_refs_unlock(), packed_refs_is_locked(): new functionsrefs/packed-backend.c refs/packed-backend.h+28 -60 replies
26/30clear_packed_ref_cache(): don't protest if the lock is heldrefs/packed-backend.c+0 -20 replies
27/30commit_packed_refs(): remove call to `packed_refs_unlock()`refs/files-backend.c refs/packed-backend.c+10 -100 replies
28/30repack_without_refs(): don't lock or unlock the packed refsrefs/files-backend.c refs/packed-backend.c+39 -400 replies
29/30t3210: add some tests of bogus packed-refs file contentst/t3210-pack-refs.sh+27 -00 replies
30/30read_packed_refs(): die if `packed-refs` contains bogus datarefs/packed-backend.c t/t3210-pack-refs.sh+10 -60 replies

Reviews trailers per patch

None of the 30 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJonathan Nieder
SeriesR-b
1/30
2/30
3/30
4/30
5/30
6/30
7/30
8/30
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/30] Create a reference backend for packed refs

This is v3 of a patch series creating a packed_ref_store reference backend. Thanks to Peff and Junio for their comments about v2 [1].

Changes since v2:

* Delete some debugging cat commands in t1408.

* Add some tests of reading packed-refs files with bogus contents.

* When reporting corruption in packed-refs files, distinguish between unterminated lines and other corruption.

* Fixed a typo in a commit message.

This patch series can also be obtained from my GitHub fork [2] as branch packed-ref-store.

Michael

[1] v1: http://public-inbox.org/git/[email protected]/

    v2: http://public-inbox.org/git/[email protected]/

[2] https://github.com/mhagger/git

Junio C Hamano (1):
t1408: add a test of stale packed refs covered by loose refs

Michael Haggerty (29):
add_packed_ref(): teach function to overwrite existing refs
packed_ref_store: new struct
packed_ref_store: move packed_refs_path here
packed_ref_store: move packed_refs_lock member here clear_packed_ref_cache(): take a packed_ref_store * parameter validate_packed_ref_cache(): take a packed_ref_store * parameter get_packed_ref_cache(): take a packed_ref_store * parameter get_packed_refs(): take a packed_ref_store * parameter add_packed_ref(): take a packed_ref_store * parameter lock_packed_refs(): take a packed_ref_store * parameter commit_packed_refs(): take a packed_ref_store * parameter rollback_packed_refs(): take a packed_ref_store * parameter get_packed_ref(): take a packed_ref_store * parameter repack_without_refs(): take a packed_ref_store * parameter packed_peel_ref(): new function, extracted from files_peel_ref()
packed_ref_store: support iteration
packed_read_raw_ref(): new function, replacing resolve_packed_ref()
packed-backend: new module for handling packed references
packed_ref_store: make class into a subclass of ref_store commit_packed_refs(): report errors rather than dying commit_packed_refs(): use a staging file separate from the lockfile packed_refs_lock(): function renamed from lock_packed_refs() packed_refs_lock(): report errors via a struct strbuf *err packed_refs_unlock(), packed_refs_is_locked(): new functions clear_packed_ref_cache(): don't protest if the lock is held commit_packed_refs(): remove call to packed_refs_unlock() repack_without_refs(): don't lock or unlock the packed refs
t3210: add some tests of bogus packed-refs file contents read_packed_refs(): die if packed-refs contains bogus data

 Makefile               |   1 +
 refs.c                 |  18 +
 refs/files-backend.c   | 631 ++++-------------------------------
 refs/packed-backend.c  | 872 +++++++++++++++++++++++++++++++++++++++++++++++++
 refs/packed-backend.h  |  25 ++
 refs/refs-internal.h   |  10 +
 t/t1408-packed-refs.sh |  42 +++
 t/t3210-pack-refs.sh   |  27 ++
 8 files changed, 1066 insertions(+), 560 deletions(-)
 create mode 100644 refs/packed-backend.c
 create mode 100644 refs/packed-backend.h
 create mode 100755 t/t1408-packed-refs.sh
Signature · 1 line
2.11.0