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: b5a36278f4f3219c1158c7891ba25fe29f5eebf7
Choose a base ref
...
head repository: git/git
compare: de0fcbe0f4987dcaa238daa0d0f9cce17afe0495
Choose a head ref
  • 10 commits
  • 6 files changed
  • 2 contributors

Commits on Aug 10, 2021

  1. Merge branch 'ar/submodule-add-config' into ar/submodule-add

    * ar/submodule-add-config:
      submodule--helper: introduce add-config subcommand
    gitster committed Aug 10, 2021
    Copy the full SHA
    59dcbb8 View commit details
    Browse the repository at this point in the history
  2. submodule--helper: add options for compute_submodule_clone_url()

    Let's modify the interface to `compute_submodule_clone_url()` function
    by adding two more arguments, so that we can reuse this in various parts
    of `submodule--helper.c` that follow a common pattern, which is--read
    the remote url configuration of the superproject and then call
    `relative_url()`.
    
    This function is nearly identical to `resolve_relative_url()`, the only
    difference being the extra warning message. We can add a quiet flag to
    it, to suppress that warning when not needed, and then refactor
    `resolve_relative_url()` by using this function, something we will do in
    the next patch.
    
    We also rename the local variable 'relurl' to avoid potential confusion
    with the 'rel_url' parameter while we are at it.
    
    Having this functionality factored out will be useful for converting the
    rest of `submodule add` in subsequent patches.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    6baf4e4 View commit details
    Browse the repository at this point in the history
  3. submodule--helper: refactor resolve_relative_url() helper

    Refactor the helper function to resolve a relative url, by reusing the
    existing `compute_submodule_clone_url()` function.
    
    `compute_submodule_clone_url()` performs the same work that
    `resolve_relative_url()` is doing, so we eliminate this code repetition
    by moving the former function's definition up, and calling it inside
    `resolve_relative_url()`.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    ab6f23b View commit details
    Browse the repository at this point in the history
  4. submodule--helper: remove repeated code in sync_submodule()

    This part of `sync_submodule()` is doing the same thing that
    `compute_submodule_clone_url()` is doing. Let's reuse that helper here.
    
    Note that this change adds a small overhead where we allocate and free
    the 'remote' twice, but that is a small price to pay for the higher
    level of abstraction we get.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    0c61041 View commit details
    Browse the repository at this point in the history
  5. dir: libify and export helper functions from clone.c

    These functions can be useful to other parts of Git. Let's move them to
    dir.c, while renaming them to be make their functionality more explicit.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    ed86301 View commit details
    Browse the repository at this point in the history
  6. submodule--helper: convert the bulk of cmd_add() to C

    Introduce the 'add' subcommand to `submodule--helper.c` that does all
    the work 'submodule add' past the parsing of flags.
    
    We also remove the constness of the sm_path field of the `add_data`
    struct. This is needed so that it can be modified by
    normalize_path_copy().
    
    As with the previous conversions, this is meant to be a faithful
    conversion with no modification to the behaviour of `submodule add`.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Helped-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Based-on-patch-by: Shourya Shukla <periperidip@gmail.com>
    Based-on-patch-by: Prathamesh Chavan <pc44800@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    a6226fd View commit details
    Browse the repository at this point in the history
  7. submodule--helper: remove add-clone subcommand

    We no longer need this subcommand, as all of its functionality is being
    called by the newly-introduced `module_add()` directly within C.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    f006132 View commit details
    Browse the repository at this point in the history
  8. submodule--helper: remove add-config subcommand

    Also no longer needed is this subcommand, as all of its functionality is
    being called by the newly-introduced `module_add()` directly within C.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    ba8a3b0 View commit details
    Browse the repository at this point in the history
  9. submodule--helper: remove resolve-relative-url subcommand

    The shell subcommand `resolve-relative-url` is no longer required, as
    its last caller has been removed when it was converted to C.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    15fe88d View commit details
    Browse the repository at this point in the history
  10. submodule--helper: rename compute_submodule_clone_url()

    Let's rename 'compute_submodule_clone_url()' to 'resolve_relative_url()'
    to make it clear that this internal helper need not be used exclusively
    for computing submodule clone URLs.
    
    Since the original 'resolve-relative-url' subcommand and its C entry
    point has been removed in c461095ae3 (submodule--helper: remove
    resolve-relative-url subcommand, 2021-07-02), this rename can be done
    without causing any confusion about which function it actually binds to.
    
    Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
    Mentored-by: Christian Couder <christian.couder@gmail.com>
    Mentored-by: Shourya Shukla <periperidip@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    tfidfwastaken authored and gitster committed Aug 10, 2021
    Copy the full SHA
    de0fcbe View commit details
    Browse the repository at this point in the history