All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] make create_branch() accept any repository
@ 2021-11-11 17:16 Glen Choo
  2021-11-11 17:16 ` [PATCH v1 1/3] refs/files-backend: remove the_repository Glen Choo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Glen Choo @ 2021-11-11 17:16 UTC (permalink / raw)
  To: git; +Cc: Glen Choo

create_branch() accepts a struct repository parameter, which seems to
suggest that it works with any repository, but it actually only works
with the_repository. This series aims to fix this discrepancy.

This series depends on gc/remote-with-fewer-static-global-variables [1]
because setup_tracking() needs tracking information from
repositories other than the_repository.

Note that this fix is not as clean as "just replace the problematic
functions with an equivalent that doesn't use the_repository".

* git_config_set() uses the_repository deep in its call chain. Patch 2
  adds an alternative implementation instead of trying to fix the entire
  call chain.
* We cannot check if a non-the_repository is bare (yet). In patch 3,
  just die instead of trying to perform this check.

While this series isn't perfect, I think it is close enough to an
"ideal" removal of the_repository that it is ready for review. My hope
is to use this series to implement "git branch --recurse-submodules"
in-process. If this series doesn't pass review, I'll implement the
feature with child processes instead.

[1] https://lore.kernel.org/git/20211028183101.41013-1-chooglen@google.com/

Glen Choo (3):
  refs/files-backend: remove the_repository
  config: introduce repo_config_set* functions
  branch: remove implicit the_repository from create_branch()

 branch.c             | 69 ++++++++++++++++++++++++++++++--------------
 branch.h             |  9 ++++--
 builtin/branch.c     |  5 ++--
 builtin/checkout.c   |  7 +++--
 config.c             | 24 +++++++++++++++
 config.h             | 11 +++++++
 refs/files-backend.c | 20 +++++++------
 7 files changed, 107 insertions(+), 38 deletions(-)

-- 
2.33.GIT


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

end of thread, other threads:[~2021-11-15 23:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 17:16 [PATCH v1 0/3] make create_branch() accept any repository Glen Choo
2021-11-11 17:16 ` [PATCH v1 1/3] refs/files-backend: remove the_repository Glen Choo
2021-11-11 17:16 ` [PATCH v1 2/3] config: introduce repo_config_set* functions Glen Choo
2021-11-11 20:24   ` Junio C Hamano
2021-11-12  0:45     ` Glen Choo
2021-11-15 22:17       ` Glen Choo
2021-11-11 17:16 ` [PATCH v1 3/3] branch: remove implicit the_repository from create_branch() Glen Choo

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.