Skip to content

Fix git-gc losing objects in multi worktree

Nguyễn Thái Ngọc Duy git 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest16 patches 23 repliesIn review
  2. v312 patches 17 repliesSuperseded
  3. v212 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v115 patches1 replySuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16revision.h: new flag in struct rev_info wrt. worktree-related refsrevision.h+1 -00 replies
2/16refs.c: use is_dir_sep() in resolve_gitlink_ref()refs.c+1 -13 replies
3/16revision.c: refactor add_index_objects_to_pending()revision.c+12 -60 replies
4/16revision.c: --indexed-objects add objects from all worktreesrevision.c t/t5304-prune.sh+30 -01 reply
5/16refs.c: refactor get_submodule_ref_store(), share common free blockrefs.c+6 -111 reply
6/16refs: move submodule slash stripping code to get_submodule_ref_storerefs.c+17 -161 reply
7/16refs: add refs_head_ref()refs.c refs.h+15 -102 replies
8/16revision.c: use refs_for_each*() instead of for_each_*_submodule()refs.c refs.h revision.c+39 -241 reply
9/16refs.c: move for_each_remote_ref_submodule() to submodule.crefs.c refs.h submodule.c+7 -80 replies
10/16refs: remove dead for_each_*_submodule()Documentation/technical/api-ref-iteration.txt refs.c refs.h+2 -482 replies
11/16revision.c: --all adds HEAD from all worktreesreachable.c revision.c submodule.c +3 more+60 -04 replies
12/16files-backend: make reflog iterator go through per-worktree reflogrefs/files-backend.c t/t1407-worktree-ref-store.sh+75 -142 replies
13/16revision.c: --reflog add HEAD reflog from all worktreesrevision.c t/t5304-prune.sh+43 -10 replies
14/16rev-list: expose and document --single-worktreeDocumentation/rev-list-options.txt revision.c+10 -01 reply
15/16refs.c: remove fallback-to-main-store code get_submodule_ref_store()refs.c+3 -81 reply
16/16refs.c: reindent get_submodule_ref_store()refs.c+5 -71 reply

Reviews trailers per patch

None of the 16 patches has a Reviewed-by or Acked-by.

PatchJohannes Sixt
1/16
2/16Noticed-by
3/16
4/16
5/16
6/16
7/16
8/16
9/16
10/16
11/16
12/16
13/16
14/16
15/16
16/16

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

Read the v4 thread

Cover letter [PATCH v4 00/16] Fix git-gc losing objects in multi worktree

"git gc" when used in multiple worktrees ignore some per-worktree
references: object references in the index, HEAD and reflog. This series fixes it by making the revision walker include these from all worktrees by default (and the series is basically split in three parts in the same order). There's a couple more cleanups in refs.c. Luckily it does not conflict with anything in 'pu'.

Compared to v3 [1], the largest change is supporting multi worktree in the reflog iterator. The merge iterator is now used (Micheal was right all along).

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

Nguyễn Thái Ngọc Duy (16):
revision.h: new flag in struct rev_info wrt. worktree-related refs refs.c: use is_dir_sep() in resolve_gitlink_ref() revision.c: refactor add_index_objects_to_pending() revision.c: --indexed-objects add objects from all worktrees refs.c: refactor get_submodule_ref_store(), share common free block
refs: move submodule slash stripping code to get_submodule_ref_store
refs: add refs_head_ref()
revision.c: use refs_for_each*() instead of for_each_*_submodule() refs.c: move for_each_remote_ref_submodule() to submodule.c
refs: remove dead for_each_*_submodule()
revision.c: --all adds HEAD from all worktrees
files-backend: make reflog iterator go through per-worktree reflog revision.c: --reflog add HEAD reflog from all worktrees
rev-list: expose and document --single-worktree
refs.c: remove fallback-to-main-store code get_submodule_ref_store() refs.c: reindent get_submodule_ref_store()

 Documentation/rev-list-options.txt            |   8 ++
 Documentation/technical/api-ref-iteration.txt |   7 +-
 reachable.c                                   |   2 +
 refs.c                                        | 110 ++++++---------------
 refs.h                                        |  20 +---
 refs/files-backend.c                          |  59 +++++++++---
 revision.c                                    | 131 +++++++++++++++++++++-----
 revision.h                                    |   1 +
 submodule.c                                   |   9 ++
 t/t1407-worktree-ref-store.sh                 |  30 ++++++
 t/t5304-prune.sh                              |  37 ++++++++
 worktree.c                                    |  22 +++++
 worktree.h                                    |   8 ++
 13 files changed, 308 insertions(+), 136 deletions(-)
Signature · 1 line
2.11.0.157.gd943d85