Skip to content

Kill the_repository in tree-walk.c

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 4 repliesIn review
  2. v16 patches 13 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6sha1-file.c: remove the_repo from read_object_with_reference()builtin/cat-file.c builtin/grep.c builtin/pack-objects.c +4 more+23 -131 reply
2/6tree-walk.c: remove the_repo from fill_tree_descriptor()builtin/merge-tree.c builtin/rebase.c builtin/reset.c +6 more+29 -210 replies
3/6tree-walk.c: remove the_repo from get_tree_entry()archive.c blame.c builtin/rm.c +8 more+38 -260 replies
4/6tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks()sha1-name.c tree-walk.c tree-walk.h+10 -140 replies
5/6match-trees.c: remove the_repo from shift_tree*()cache.h match-trees.c merge-recursive.c +1 more+12 -100 replies
6/6Use the right 'struct repository' instead of the_repositorymerge-recursive.c sequencer.c sha1-name.c +1 more+26 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] Kill the_repository in tree-walk.c

v2 fixes t7814 flakiness. The problem is git-grep can operate on multiple repos and I read objects from the wrong repo (supermodule) instead of the submodule one.

There are still the_repository hidden in git-grep code paths, and the hack of asborbing submodule's object db to the_repo's in order to make it work. And I can't quite understand how t7814 sometimes passed.

I'll revisit this after this series is done and will try to get rid of add_to_alternates_memory() in git-grep.

Nguyễn Thái Ngọc Duy (6):
sha1-file.c: remove the_repo from read_object_with_reference() tree-walk.c: remove the_repo from fill_tree_descriptor() tree-walk.c: remove the_repo from get_tree_entry() tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks() match-trees.c: remove the_repo from shift_tree*()
Use the right 'struct repository' instead of the_repository

 archive.c                   |  4 +++-
 blame.c                     |  4 ++--
 builtin/cat-file.c          |  3 ++-
 builtin/grep.c              |  6 ++++--
 builtin/merge-tree.c        | 22 +++++++++++--------
 builtin/pack-objects.c      |  3 ++-
 builtin/rebase.c            |  4 ++--
 builtin/reset.c             |  4 ++--
 builtin/rm.c                |  2 +-
 builtin/update-index.c      |  2 +-
 cache.h                     |  7 +++---
 fast-import.c               |  9 +++++---
 line-log.c                  |  7 +++---
 match-trees.c               | 12 ++++++-----
 merge-recursive.c           | 43 +++++++++++++++++++++----------------
 notes.c                     |  4 ++--
 sequencer.c                 |  6 +++---
 sha1-file.c                 |  5 +++--
 sha1-name.c                 | 25 +++++++--------------
 shallow.c                   |  3 ++-
 t/helper/test-match-trees.c |  2 +-
 tree-diff.c                 |  4 ++--
 tree-walk.c                 | 35 ++++++++++++++++++++----------
 tree-walk.h                 |  8 ++++---
 unpack-trees.c              |  2 +-
 25 files changed, 129 insertions(+), 97 deletions(-)

Range-diff dựa trên v1:
1: 35d7cdbe6a ! 1: 9e73c39f9a sha1-file.c: remove the_repo from read_object_with_reference()

    @@ -3,7 +3,6 @@
         sha1-file.c: remove the_repo from read_object_with_reference()
     
         Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    -    Signed-off-by: Junio C Hamano <[email protected]>
     
      diff --git a/builtin/cat-file.c b/builtin/cat-file.c
      --- a/builtin/cat-file.c
    @@ -27,7 +26,7 @@
      
      		grep_read_lock();
     -		data = read_object_with_reference(&object->oid, tree_type,
    -+		data = read_object_with_reference(opt->repo,
    ++		data = read_object_with_reference(&subrepo,
     +						  &object->oid, tree_type,
      						  &size, NULL);
      		grep_read_unlock();
2:  4ff146fb64 = 2:  b9107f7503 tree-walk.c: remove the_repo from fill_tree_descriptor()
3:  47f956bd0f = 3:  87ed67bde5 tree-walk.c: remove the_repo from get_tree_entry()
4:  e19c4b9ce6 = 4:  557b61f2ba tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks()
5:  3fe87a7fde = 5:  53f09e0437 match-trees.c: remove the_repo from shift_tree*()
6:  6d0449f1a7 = 6:  d5d4d2ba65 Use the right 'struct repository' instead of the_repository
Signature · 1 line
2.22.0.rc0.322.g2b0371e29a