Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
base: 0785eb769886ae81e346df10e88bc49ffc0ac64e
Choose a base ref
...
head repository: git/git
compare: 10a0d6ae64ad4fec12ab2c1ed13d1791dde60371
Choose a head ref
  • 3 commits
  • 11 files changed
  • 1 contributor

Commits on Sep 9, 2021

  1. submodule: remove unnecessary unabsorbed fallback

    In get_submodule_repo_for(), there is a fallback code path for the case
    in which a submodule has an unabsorbed gitdir. (See the documentation
    for "git submodule absorbgitdirs" for more information about absorbed
    and unabsorbed gitdirs.) However, this code path is unnecessary, because
    such submodules are already handled: when the fetch_task is created in
    fetch_task_create(), it will create its own struct submodule with a path
    and name, and repo_submodule_init() can handle such a struct.
    
    This fallback was introduced in 26f80cc ("submodule: migrate
    get_next_submodule to use repository structs", 2018-12-05). It was
    unnecessary even then, but perhaps it escaped notice because its parent
    commit d5498e0 ("repository: repo_submodule_init to take a submodule
    struct", 2018-12-05) was the one that taught repo_submodule_init() to
    handle such created structs. Before, it took a path and always checked
    .gitmodules, so it truly would have failed if there were no entry in
    .gitmodules.
    
    (Note to reviewers: in 26f80cc, the "own struct submodule" I
    mentioned is in get_next_submodule(), not fetch_task_create().)
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 9, 2021
    Copy the full SHA
    5df5106 View commit details
    Browse the repository at this point in the history
  2. repository: support unabsorbed in repo_submodule_init

    In preparation for a subsequent commit that migrates code using
    add_submodule_odb() to repo_submodule_init(), teach
    repo_submodule_init() to support submodules with unabsorbed gitdirs.
    (See the documentation for "git submodule absorbgitdirs" for more
    information about absorbed and unabsorbed gitdirs.)
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 9, 2021
    Copy the full SHA
    8eb8dcf View commit details
    Browse the repository at this point in the history
  3. revision: remove "submodule" from opt struct

    Clean up a TODO in revision.h by removing the "submodule" field from
    struct setup_revision_opt. This field is only used to specify the ref
    store to use, so use rev_info->repo to determine the ref store instead.
    
    The only users of this field are merge-ort.c and merge-recursive.c.
    However, both these files specify the superproject as rev_info->repo and
    the submodule as setup_revision_opt->submodule. In order to be able to
    pass the submodule as rev_info->repo, all commits must be parsed with
    the submodule explicitly specified; this patch does that as well. (An
    incremental solution in which only some commits are parsed with explicit
    submodule will not work, because if the same commit is parsed twice in
    different repositories, there will be 2 heap-allocated object structs
    corresponding to that commit, and any flag set by the revision walking
    mechanism on one of them will not be reflected onto the other.)
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 9, 2021
    Copy the full SHA
    10a0d6a View commit details
    Browse the repository at this point in the history