All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/31] Kill the_repository in sha1-name.c
@ 2019-02-17 10:08 Nguyễn Thái Ngọc Duy
  2019-02-17 10:08 ` [PATCH 01/31] packfile.c: add repo_approximate_object_count() Nguyễn Thái Ngọc Duy
                   ` (30 more replies)
  0 siblings, 31 replies; 33+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2019-02-17 10:08 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

This whole series is to fix a known issue from
ao/submodule-wo-gitmodules-checked-out. Commit 76e9bdc437 (submodule:
support reading .gitmodules when it's not in the working tree -
2018-10-25) makes "git grep --recurse-submodules" print

    warning: nested submodules ... not supported yet

one line per submodule. And it's really annoying when a repo has lots
of (non-nested) submodules.

Fixing it requires resolving an extended SHA-1 syntax from a separate
repository. Which basically means the whole sha1-name.c has to be
aware of 'struct repository' (and a bit more from refs.c as well).

Technically merge-recursive.c, tree-walk.c and config.c have to take
'struct repository *' too, but I reduce the scope a bit since it's
already long.

The main fix is 28/31. The rest is just converting code to use 'struct
repository *'. Patches after 28/31 are technically not needed, but
since I have converted most of sha1-name.c, might as well convert the
rest.

There is a new function get_oidf() from another series on 'pu', which
can't be converted right now of course. But it could be fixed easily
later. It also causes a conflict in cache.h but resolving is straight
forward.

Nguyễn Thái Ngọc Duy (31):
  packfile.c: add repo_approximate_object_count()
  refs.c: add refs_ref_exists()
  refs.c: add refs_shorten_unambiguous_ref()
  refs.c: remove the_repo from substitute_branch_name()
  refs.c: remove the_repo from expand_ref()
  refs.c: add repo_dwim_ref()
  refs.c: add repo_dwim_log()
  refs.c: remove the_repo from read_ref_at()
  commit.c: add repo_get_commit_tree()
  sha1-name.c: remove the_repo from sort_ambiguous()
  sha1-name.c: remove the_repo from find_abbrev_len_packed()
  sha1-name.c: add repo_find_unique_abbrev_r()
  sha1-name.c: store and use repo in struct disambiguate_state
  sha1-name.c: add repo_for_each_abbrev()
  sha1-name.c: remove the_repo from get_short_oid()
  sha1-name.c: remove the_repo from interpret_nth_prior_checkout()
  sha1-name.c: remove the_repo from interpret_branch_mark()
  sha1-name.c: add repo_interpret_branch_name()
  sha1-name.c: remove the_repo from get_oid_oneline()
  sha1-name.c: remove the_repo from get_describe_name()
  sha1-name.c: remove the_repo from get_oid_basic()
  sha1-name.c: remove the_repo from get_oid_1()
  sha1-name.c: remove the_repo from handle_one_ref()
  sha1-name.c: remove the_repo from diagnose_invalid_index_path()
  sha1-name.c: remove the_repo from resolve_relative_path()
  sha1-name.c: remove the_repo from get_oid_with_context_1()
  sha1-name.c: add repo_get_oid()
  submodule-config.c: use repo_get_oid for reading .gitmodules
  sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name
  sha1-name.c: remove the_repo from other get_oid_*
  sha1-name.c: remove the_repo from get_oid_mb()

 builtin/show-branch.c              |   6 +-
 cache.h                            |  50 ++--
 commit.c                           |   5 +-
 commit.h                           |   3 +-
 dir.c                              |   8 +
 dir.h                              |   4 +-
 packfile.c                         |  14 +-
 packfile.h                         |   3 +-
 refs.c                             |  71 ++++--
 refs.h                             |   9 +-
 setup.c                            |   7 +-
 sha1-name.c                        | 388 ++++++++++++++++++-----------
 submodule-config.c                 |  20 +-
 t/t7814-grep-recurse-submodules.sh |   6 +-
 upload-pack.c                      |   2 +-
 15 files changed, 371 insertions(+), 225 deletions(-)

-- 
2.21.0.rc0.328.g0e39304f8d


^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH 00/31] Kill the_repository in sha1-name.c
@ 2019-03-30 11:18 Nguyễn Thái Ngọc Duy
  2019-03-30 11:18 ` [PATCH 03/31] refs.c: add refs_shorten_unambiguous_ref() Nguyễn Thái Ngọc Duy
  0 siblings, 1 reply; 33+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2019-03-30 11:18 UTC (permalink / raw)
  To: git; +Cc: Stefan Beller, Junio C Hamano, Nguyễn Thái Ngọc Duy

This whole series is to fix a known issue from
ao/submodule-wo-gitmodules-checked-out. Commit 76e9bdc437 (submodule:
support reading .gitmodules when it's not in the working tree -
2018-10-25) makes "git grep --recurse-submodules" print

    warning: nested submodules ... not supported yet

one line per submodule. And it's really annoying when a repo has lots
of (non-nested) submodules.

Fixing it requires resolving an extended SHA-1 syntax from a separate
repository. Which basically means the whole sha1-name.c has to be
aware of 'struct repository' (and a bit more from refs.c as well).

Technically merge-recursive.c, tree-walk.c and config.c have to take
'struct repository *' too, but I reduce the scope a bit since it's
already long.

The main fix is 28/31. The rest is just converting code to use 'struct
repository *'. Patches after 28/31 are technically not needed, but
since I have converted most of sha1-name.c, might as well convert the
rest.

There is a new function get_oidf() from another series on 'pu', which
can't be converted right now of course. But it could be fixed easily
later. It also causes a conflict in cache.h but resolving is straight
forward.

Nguyễn Thái Ngọc Duy (31):
  packfile.c: add repo_approximate_object_count()
  refs.c: add refs_ref_exists()
  refs.c: add refs_shorten_unambiguous_ref()
  refs.c: remove the_repo from substitute_branch_name()
  refs.c: remove the_repo from expand_ref()
  refs.c: add repo_dwim_ref()
  refs.c: add repo_dwim_log()
  refs.c: remove the_repo from read_ref_at()
  commit.c: add repo_get_commit_tree()
  sha1-name.c: remove the_repo from sort_ambiguous()
  sha1-name.c: remove the_repo from find_abbrev_len_packed()
  sha1-name.c: add repo_find_unique_abbrev_r()
  sha1-name.c: store and use repo in struct disambiguate_state
  sha1-name.c: add repo_for_each_abbrev()
  sha1-name.c: remove the_repo from get_short_oid()
  sha1-name.c: remove the_repo from interpret_nth_prior_checkout()
  sha1-name.c: remove the_repo from interpret_branch_mark()
  sha1-name.c: add repo_interpret_branch_name()
  sha1-name.c: remove the_repo from get_oid_oneline()
  sha1-name.c: remove the_repo from get_describe_name()
  sha1-name.c: remove the_repo from get_oid_basic()
  sha1-name.c: remove the_repo from get_oid_1()
  sha1-name.c: remove the_repo from handle_one_ref()
  sha1-name.c: remove the_repo from diagnose_invalid_index_path()
  sha1-name.c: remove the_repo from resolve_relative_path()
  sha1-name.c: remove the_repo from get_oid_with_context_1()
  sha1-name.c: add repo_get_oid()
  submodule-config.c: use repo_get_oid for reading .gitmodules
  sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name
  sha1-name.c: remove the_repo from other get_oid_*
  sha1-name.c: remove the_repo from get_oid_mb()

 builtin/show-branch.c              |   6 +-
 cache.h                            |  50 ++--
 commit.c                           |   5 +-
 commit.h                           |   3 +-
 dir.c                              |   8 +
 dir.h                              |   4 +-
 packfile.c                         |  14 +-
 packfile.h                         |   3 +-
 refs.c                             |  71 ++++--
 refs.h                             |   9 +-
 setup.c                            |   7 +-
 sha1-name.c                        | 388 ++++++++++++++++++-----------
 submodule-config.c                 |  20 +-
 t/t7814-grep-recurse-submodules.sh |   6 +-
 upload-pack.c                      |   2 +-
 15 files changed, 371 insertions(+), 225 deletions(-)

-- 
2.21.0.479.g47ac719cd3


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2019-03-30 11:20 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-17 10:08 [PATCH 00/31] Kill the_repository in sha1-name.c Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 01/31] packfile.c: add repo_approximate_object_count() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 02/31] refs.c: add refs_ref_exists() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 03/31] refs.c: add refs_shorten_unambiguous_ref() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 04/31] refs.c: remove the_repo from substitute_branch_name() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 05/31] refs.c: remove the_repo from expand_ref() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 06/31] refs.c: add repo_dwim_ref() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 07/31] refs.c: add repo_dwim_log() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 08/31] refs.c: remove the_repo from read_ref_at() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 09/31] commit.c: add repo_get_commit_tree() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 10/31] sha1-name.c: remove the_repo from sort_ambiguous() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 11/31] sha1-name.c: remove the_repo from find_abbrev_len_packed() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 12/31] sha1-name.c: add repo_find_unique_abbrev_r() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 13/31] sha1-name.c: store and use repo in struct disambiguate_state Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 14/31] sha1-name.c: add repo_for_each_abbrev() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 15/31] sha1-name.c: remove the_repo from get_short_oid() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 16/31] sha1-name.c: remove the_repo from interpret_nth_prior_checkout() Nguyễn Thái Ngọc Duy
2019-02-17 10:08 ` [PATCH 17/31] sha1-name.c: remove the_repo from interpret_branch_mark() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 18/31] sha1-name.c: add repo_interpret_branch_name() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 19/31] sha1-name.c: remove the_repo from get_oid_oneline() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 20/31] sha1-name.c: remove the_repo from get_describe_name() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 21/31] sha1-name.c: remove the_repo from get_oid_basic() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 22/31] sha1-name.c: remove the_repo from get_oid_1() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 23/31] sha1-name.c: remove the_repo from handle_one_ref() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 24/31] sha1-name.c: remove the_repo from diagnose_invalid_index_path() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 25/31] sha1-name.c: remove the_repo from resolve_relative_path() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 26/31] sha1-name.c: remove the_repo from get_oid_with_context_1() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 27/31] sha1-name.c: add repo_get_oid() Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 28/31] submodule-config.c: use repo_get_oid for reading .gitmodules Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 29/31] sha1-name.c: remove the_repo from maybe_die_on_misspelt_object_name Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 30/31] sha1-name.c: remove the_repo from other get_oid_* Nguyễn Thái Ngọc Duy
2019-02-17 10:09 ` [PATCH 31/31] sha1-name.c: remove the_repo from get_oid_mb() Nguyễn Thái Ngọc Duy
2019-03-30 11:18 [PATCH 00/31] Kill the_repository in sha1-name.c Nguyễn Thái Ngọc Duy
2019-03-30 11:18 ` [PATCH 03/31] refs.c: add refs_shorten_unambiguous_ref() Nguyễn Thái Ngọc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.