git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/3] More add_submodule_odb() cleanup in merge code

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Sep 8, 2021, 18:18 UTC
Message-ID
<cover.1631123754.git.jonathantanmy@google.com>
(CC-ing Elijah in case he has insight into the merge-ort part.)

While continuing the effort into removing add_submodule_odb() (as part of the submodule partial clone effort) I came across this part of the merge code that specifies the repository being operated on in two ways: one as a struct repository pointer and the other as a path. This patch set unifies the two.

I normally would not send refactoring patches unless I also have a feature patch that uses the results of said refactoring, but in this case, I think that these patches are worth having since they clarify a potentially unclear part of the API.

Note that these patches mean that the merging code no longer supports submodules that have their .git dirs in the worktree, but from what I can tell, this seems to be the direction we're going in (repo_submodule_init() does not support such submodules).

Patch 3 is included to show how I'm verifying some things. Including something like that in the master branch would probably require conditional compilation (to exclude the additional field in struct object used for checking, among other things), so I'm just including it here for informational purposes.

All these patches work under GIT_TEST_MERGE_ALGORITHM=recursive and GIT_TEST_MERGE_ALGORITHM=ort (and when that envvar is unset, for good measure).

Jonathan Tan (3):
  t6437: run absorbgitdirs on repos
  revision: remove "submodule" from opt struct
  DO NOT SUBMIT commit-reach,revision: verify non-mixing
 alloc.c                    |  2 +
 commit-reach.c             | 60 +++++++++++++++++-------
 merge-ort.c                | 55 +++++++++++++++-------
 merge-recursive.c          | 51 +++++++++++++-------
 object.h                   |  1 +
 revision.c                 | 96 ++++++++++++++++++++++----------------
 revision.h                 |  1 -
 t/t6437-submodule-merge.sh |  9 ++--
 8 files changed, 179 insertions(+), 96 deletions(-)
-- 
2.33.0.309.g3052b89438-goog
Next: Jonathan Tan
Message 1 of 14 in “More add_submodule_odb() cleanup in merge code”
  1. 0/3 More add_submodule_odb() cleanup in merge codeJonathan Tan, Sep 8, 2021
  2. 1/3 t6437: run absorbgitdirs on reposJonathan Tan, Sep 8, 2021
  3. Jonathan TanSep 8, 2021
  4. Junio C HamanoSep 8, 2021
  5. Jonathan TanSep 9, 2021
  6. 2/3 revision: remove "submodule" from opt structJonathan Tan, Sep 8, 2021
  7. 3/3 DO NOT SUBMIT commit-reach,revision: verify non-mixingJonathan Tan, Sep 8, 2021
  8. Elijah NewrenSep 9, 2021
  9. Jonathan TanSep 9, 2021
  10. 0/3 More add_submodule_odb() cleanup in merge codeJonathan Tan, Sep 9, 2021
  11. 1/3 submodule: remove unnecessary unabsorbed fallbackJonathan Tan, Sep 9, 2021
  12. 2/3 repository: support unabsorbed in repo_submodule_initJonathan Tan, Sep 9, 2021
  13. 3/3 revision: remove "submodule" from opt structJonathan Tan, Sep 9, 2021
  14. Elijah NewrenSep 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.