mbox series

[0/3] Remove is_bare_repository_cfg global state

Message ID pull.1826.git.git.1730926082.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Remove is_bare_repository_cfg global state | expand

Message

Elijah Newren via GitGitGadget Nov. 6, 2024, 8:47 p.m. UTC
This patch series removes the global state introduced by the
is_bare_repository_cfg variable by moving it into the repository struct.
Most of the refactor is done by patch 1. Patch 2 initializes the member in
places that left it unInitialized, while patch 3 adds a safety measure by
BUG()ing when the variable has not been properly initialized.

John Cai (3):
  git: remove is_bare_repository_cfg global variable
  setup: initialize is_bare_cfg
  repository: BUG when is_bare_cfg is not initialized

 attr.c                        |  4 ++--
 builtin/bisect.c              |  2 +-
 builtin/blame.c               |  2 +-
 builtin/check-attr.c          |  2 +-
 builtin/clone.c               |  4 ++--
 builtin/gc.c                  |  2 +-
 builtin/init-db.c             | 14 +++++++-------
 builtin/repack.c              |  2 +-
 builtin/reset.c               |  2 +-
 builtin/rev-parse.c           |  2 +-
 builtin/submodule--helper.c   |  2 +-
 config.c                      |  2 +-
 dir.c                         |  2 +-
 environment.c                 |  7 -------
 environment.h                 |  3 +--
 git.c                         |  2 +-
 mailmap.c                     |  4 ++--
 refs/files-backend.c          |  2 +-
 refs/reftable-backend.c       |  2 +-
 repository.c                  | 23 +++++++++++++++++++----
 repository.h                  | 12 +++++++++++-
 scalar.c                      |  2 +-
 setup.c                       | 19 +++++++++++++------
 submodule.c                   |  2 +-
 t/helper/test-partial-clone.c |  2 +-
 t/helper/test-repository.c    |  4 ++--
 transport.c                   |  4 ++--
 worktree.c                    |  4 ++--
 28 files changed, 79 insertions(+), 55 deletions(-)


base-commit: 8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1826%2Fjohn-cai%2Fjc%2Fremove_is_bare_global-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1826/john-cai/jc/remove_is_bare_global-v1
Pull-Request: https://github.com/git/git/pull/1826

Comments

Junio C Hamano Nov. 26, 2024, 8:08 a.m. UTC | #1
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

> This patch series removes the global state introduced by the
> is_bare_repository_cfg variable by moving it into the repository struct.
> Most of the refactor is done by patch 1. Patch 2 initializes the member in
> places that left it unInitialized, while patch 3 adds a safety measure by
> BUG()ing when the variable has not been properly initialized.

I think these patches go in the right direction in general, but the
topic hasn't seen much activity for a few weeks since they received
review messages.  Is a new revision being worked on, or is the topic
being backburnered?

Thanks.
Junio C Hamano Dec. 11, 2024, 11:09 p.m. UTC | #2
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

> This patch series removes the global state introduced by the
> is_bare_repository_cfg variable by moving it into the repository struct.
> Most of the refactor is done by patch 1. Patch 2 initializes the member in
> places that left it unInitialized, while patch 3 adds a safety measure by
> BUG()ing when the variable has not been properly initialized.
>
> John Cai (3):
>   git: remove is_bare_repository_cfg global variable
>   setup: initialize is_bare_cfg
>   repository: BUG when is_bare_cfg is not initialized

We've been seeing a job "win test (5)" fail on 'seen' for a while,
and I happened to have rebuilt 'seen' without this topic (first by
accident) and the job started passing.

The topic coming from GGG, I'd assume that it byitself will pass the
tests (including Windows ones), so I suspect it is some interaction
with other topics in 'seen'.

As I do not have Windows environment to test and dig into any
problem, often pushing 'seen' with suspect topic(s) removed is the
only way for me to isolate which topic might be causing a problem,
and after doing so, I'll have to leave it up to the author of the
topic to dig further with help from others.

(failing) https://github.com/git/git/actions/runs/12279217687/job/34263221584
(passing) https://github.com/git/git/actions/runs/12286174648/job/34286039276

The difference between these is that the former (failing) one has
this topic with three patches merged at the tip of 'seen', and the
latter (passing) one is the result of tentatively dropping this
topic from the CI run.

Thanks.