git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] Stop using `the_repository` in "config.c"
@ 2024-08-07  6:56 Patrick Steinhardt
  2024-08-07  6:56 ` [PATCH 01/20] path: expose `do_git_path()` as `repo_git_pathv()` Patrick Steinhardt
                   ` (21 more replies)
  0 siblings, 22 replies; 69+ messages in thread
From: Patrick Steinhardt @ 2024-08-07  6:56 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 5419 bytes --]

Hi,

I found that there had been a bunch of callsites in code
not marked with `USE_THE_REPOSITORY_VARIABLE` that still implicitly
relied on `the_repository` due to calling interfaces of "config.c".
This patch series has the goal of fixing that and making the dependency
implicit. This is done by making "config.c" stop using `the_repository`
while moving its interfaces that do use it into "config.h", guarded by
the `USE_THE_REPOSITORY_VARIABLE` macro.

The series is structured as follows:

  - Patches 1 to 7 adapt "path.{c,h}" to become `the_repository`-clean.
    This is required because "config.c" relies on the "path" subsystem
    quite a lot.

  - Patches 8 and 9 introduce functions that take a `struct repository`
    where we didn't yet equivalents for the repo-less variants.

  - Patches 10 to 16 adapt various functions to take a `struct
    repository` as input.

  - Patches 17 and 18 fix up some functions that take a `struct
    repository`, but still rely on `the_repository`.

  - Patches 19 and 20 then hide config functions that rely on
    `the_repository` behind `USE_THE_REPOSITORY_VARIABLE`.

The series is built on top of `master` at 406f326d27 (The second batch,
2024-08-01) with ps/refs-wo-the-repository at 9d36dbd1ff (refs/reftable:
stop using `the_repository`, 2024-07-30) merged into it.

Thanks!

Patrick

Patrick Steinhardt (20):
  path: expose `do_git_path()` as `repo_git_pathv()`
  path: expose `do_git_common_path()` as `strbuf_git_common_pathv()`
  editor: do not rely on `the_repository` for interactive edits
  hooks: remove implicit dependency on `the_repository`
  path: stop relying on `the_repository` when reporting garbage
  path: stop relying on `the_repository` in `worktree_git_path()`
  path: hide functions using `the_repository` by default
  config: introduce missing setters that take repo as parameter
  config: expose `repo_config_clear()`
  config: pass repo to `git_config_get_index_threads()`
  config: pass repo to `git_config_get_split_index()`
  config: pass repo to `git_config_get_max_percent_split_change()`
  config: pass repo to `git_config_get_expiry()`
  config: pass repo to `git_config_get_expiry_in_days()`
  config: pass repo to `git_die_config()`
  config: pass repo to functions that rename or copy sections
  config: don't have setters depend on `the_repository`
  config: don't depend on `the_repository` with branch conditions
  global: prepare for hiding away repo-less config functions
  config: hide functions using `the_repository` by default

 add-patch.c                       |   3 +-
 builtin/am.c                      |   9 +-
 builtin/branch.c                  |   7 +-
 builtin/bugreport.c               |   2 +-
 builtin/checkout.c                |   2 +-
 builtin/clone.c                   |   2 +-
 builtin/config.c                  |  16 +-
 builtin/count-objects.c           |   2 +-
 builtin/fast-import.c             |   4 +-
 builtin/fsck.c                    |   2 +-
 builtin/gc.c                      |   8 +-
 builtin/hook.c                    |   2 +-
 builtin/merge.c                   |   2 +-
 builtin/notes.c                   |   2 +-
 builtin/rebase.c                  |   2 +-
 builtin/receive-pack.c            |  10 +-
 builtin/remote.c                  |   4 +-
 builtin/submodule--helper.c       |   2 +-
 builtin/update-index.c            |   4 +-
 builtin/worktree.c                |   6 +-
 commit.c                          |   2 +-
 compat/fsmonitor/fsm-ipc-darwin.c |   2 +
 compat/precompose_utf8.c          |   1 +
 config.c                          | 225 ++++++++---------------
 config.h                          | 285 +++++++++++++++++++++---------
 connect.c                         |   2 +
 credential.c                      |   2 +
 daemon.c                          |   2 +
 editor.c                          |  14 +-
 editor.h                          |   3 +-
 fsmonitor.c                       |   2 +
 gpg-interface.c                   |   2 +
 graph.c                           |   2 +
 hook.c                            |  21 +--
 hook.h                            |  13 +-
 imap-send.c                       |   2 +
 mailinfo.c                        |   2 +
 merge-ll.c                        |   2 +
 parallel-checkout.c               |   2 +
 path.c                            |  97 +++-------
 path.h                            | 167 +++++++++++------
 protocol.c                        |   2 +
 read-cache.c                      |  22 +--
 refs.c                            |   4 +-
 refs/packed-backend.c             |   2 +
 refs/reftable-backend.c           |   2 +
 rerere.c                          |   4 +-
 reset.c                           |   2 +-
 revision.c                        |   2 +-
 sequencer.c                       |   6 +-
 sideband.c                        |   2 +
 submodule.c                       |   2 +-
 t/helper/test-advise.c            |   2 +
 t/helper/test-config.c            |   2 +
 t/helper/test-userdiff.c          |   2 +
 trailer.c                         |   2 +
 transport.c                       |   2 +-
 versioncmp.c                      |   2 +
 worktree.c                        |   2 +-
 wt-status.c                       |  14 +-
 60 files changed, 564 insertions(+), 455 deletions(-)

-- 
2.46.0.dirty


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-08-15  5:26 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  6:56 [PATCH 00/20] Stop using `the_repository` in "config.c" Patrick Steinhardt
2024-08-07  6:56 ` [PATCH 01/20] path: expose `do_git_path()` as `repo_git_pathv()` Patrick Steinhardt
2024-08-09 16:58   ` Justin Tobler
2024-08-13  9:25     ` Patrick Steinhardt
2024-08-07  6:56 ` [PATCH 02/20] path: expose `do_git_common_path()` as `strbuf_git_common_pathv()` Patrick Steinhardt
2024-08-09 17:18   ` Justin Tobler
2024-08-09 17:32     ` Junio C Hamano
2024-08-13  9:25       ` Patrick Steinhardt
2024-08-13 15:12         ` Junio C Hamano
2024-08-07  6:56 ` [PATCH 03/20] editor: do not rely on `the_repository` for interactive edits Patrick Steinhardt
2024-08-09 17:36   ` Justin Tobler
2024-08-07  6:57 ` [PATCH 04/20] hooks: remove implicit dependency on `the_repository` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 05/20] path: stop relying on `the_repository` when reporting garbage Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 06/20] path: stop relying on `the_repository` in `worktree_git_path()` Patrick Steinhardt
2024-08-09 19:02   ` Justin Tobler
2024-08-13  9:25     ` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 07/20] path: hide functions using `the_repository` by default Patrick Steinhardt
2024-08-09 19:43   ` Justin Tobler
2024-08-13  9:25     ` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 08/20] config: introduce missing setters that take repo as parameter Patrick Steinhardt
2024-08-09 20:07   ` Justin Tobler
2024-08-13  9:25     ` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 09/20] config: expose `repo_config_clear()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 10/20] config: pass repo to `git_config_get_index_threads()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 11/20] config: pass repo to `git_config_get_split_index()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 12/20] config: pass repo to `git_config_get_max_percent_split_change()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 13/20] config: pass repo to `git_config_get_expiry()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 14/20] config: pass repo to `git_config_get_expiry_in_days()` Patrick Steinhardt
2024-08-09 20:21   ` Justin Tobler
2024-08-09 21:14     ` Junio C Hamano
2024-08-07  6:57 ` [PATCH 15/20] config: pass repo to `git_die_config()` Patrick Steinhardt
2024-08-07  6:57 ` [PATCH 16/20] config: pass repo to functions that rename or copy sections Patrick Steinhardt
2024-08-07  6:58 ` [PATCH 17/20] config: don't have setters depend on `the_repository` Patrick Steinhardt
2024-08-07  6:58 ` [PATCH 18/20] config: don't depend on `the_repository` with branch conditions Patrick Steinhardt
2024-08-09 20:47   ` Justin Tobler
2024-08-13  9:25     ` Patrick Steinhardt
2024-08-07  6:58 ` [PATCH 19/20] global: prepare for hiding away repo-less config functions Patrick Steinhardt
2024-08-09 20:57   ` Justin Tobler
2024-08-07  6:58 ` [PATCH 20/20] config: hide functions using `the_repository` by default Patrick Steinhardt
2024-08-09 21:13   ` Justin Tobler
2024-08-07  9:48 ` [PATCH 00/20] Stop using `the_repository` in "config.c" Ghanshyam Thakkar
2024-08-07 13:11   ` Patrick Steinhardt
2024-08-13  9:13 ` [PATCH v2 " Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 01/20] path: expose `do_git_path()` as `repo_git_pathv()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 02/20] path: expose `do_git_common_path()` as `repo_common_pathv()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 03/20] editor: do not rely on `the_repository` for interactive edits Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 04/20] hooks: remove implicit dependency on `the_repository` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 05/20] path: stop relying on `the_repository` when reporting garbage Patrick Steinhardt
2024-08-14 18:28     ` Calvin Wan
2024-08-15  5:26       ` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 06/20] path: stop relying on `the_repository` in `worktree_git_path()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 07/20] path: hide functions using `the_repository` by default Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 08/20] config: introduce missing setters that take repo as parameter Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 09/20] config: expose `repo_config_clear()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 10/20] config: pass repo to `git_config_get_index_threads()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 11/20] config: pass repo to `git_config_get_split_index()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 12/20] config: pass repo to `git_config_get_max_percent_split_change()` Patrick Steinhardt
2024-08-13  9:13   ` [PATCH v2 13/20] config: pass repo to `git_config_get_expiry()` Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 14/20] config: pass repo to `git_config_get_expiry_in_days()` Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 15/20] config: pass repo to `git_die_config()` Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 16/20] config: pass repo to functions that rename or copy sections Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 17/20] config: don't have setters depend on `the_repository` Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 18/20] config: don't depend on `the_repository` with branch conditions Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 19/20] global: prepare for hiding away repo-less config functions Patrick Steinhardt
2024-08-13  9:14   ` [PATCH v2 20/20] config: hide functions using `the_repository` by default Patrick Steinhardt
2024-08-13 17:07   ` [PATCH v2 00/20] Stop using `the_repository` in "config.c" Junio C Hamano
2024-08-14 19:29   ` Calvin Wan
2024-08-15  5:13     ` Patrick Steinhardt
2024-08-15  0:58   ` Justin Tobler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).