From: Orgad Shaneh <orgads@gmail.com>
To: git <git@vger.kernel.org>
Subject: Re: Performance regression on git fetch in 2.21
Date: Mon, 10 Jun 2019 16:55:29 +0300 [thread overview]
Message-ID: <CAGHpTBLvVLY4YTp6c1x66WvO-OsqqTQ_-DAvBi20LFz-BG0+uA@mail.gmail.com> (raw)
In-Reply-To: <CAGHpTBKSUJzFSWc=uznSu2zB33qCSmKXM-iAjxRCpqNK5bnhRg@mail.gmail.com>
On Fri, May 24, 2019 at 12:14 PM Orgad Shaneh <orgads@gmail.com> wrote:
>
> Hi,
>
> git fetch in my repository *when nothing new is received* takes 2.5x
> the time when comparing 2.20 against 2.21 (on Windows it's 4x).
>
> I have 5 initialized submodules in this working directory.
>
> I reported this issue on git-for-windows github:
> https://github.com/git-for-windows/git/issues/2199 but there is also
> an upstream change related.
>
> I bisected and found this commit to blame:
>
> Building... Fetching... Failed [10.7949124]
> Bisecting: 0 revisions left to test after this (roughly 0 steps)
> [a62387b3fc9f5aeeb04a2db278121d33a9caafa7] submodule.c: fetch in
> submodules git directory instead of in worktree
> running git-bisect.rb
> Building... Fetching... Success [4.303592]
> be76c2128234d94b47f7087152ee55d08bb65d88 is the first bad commit
> commit be76c2128234d94b47f7087152ee55d08bb65d88
> Author: Stefan Beller <sbeller@google.com>
> Date: Thu Dec 6 13:26:55 2018 -0800
>
> fetch: ensure submodule objects fetched
>
> Currently when git-fetch is asked to recurse into submodules, it dispatches
> a plain "git-fetch -C <submodule-dir>" (with some submodule related options
> such as prefix and recusing strategy, but) without any information of the
> remote or the tip that should be fetched.
>
> But this default fetch is not sufficient, as a newly fetched commit in
> the superproject could point to a commit in the submodule that is not
> in the default refspec. This is common in workflows like Gerrit's.
> When fetching a Gerrit change under review (from refs/changes/??), the
> commits in that change likely point to submodule commits that have not
> been merged to a branch yet.
>
> Fetch a submodule object by id if the object that the superproject
> points to, cannot be found. For now this object is fetched from the
> 'origin' remote as we defer getting the default remote to a later patch.
>
> A list of new submodule commits are already generated in certain
> conditions (by check_for_new_submodule_commits()); this new feature
> invokes that function in more situations.
>
> The submodule checks were done only when a ref in the superproject
> changed, these checks were extended to also be performed when fetching
> into FETCH_HEAD for completeness, and add a test for that too.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> :040000 040000 2bad86c248b79ef1e36ea5edaa423cd73445c9a2
> ad989a8f3e6f80d4f5a84ec3db0ff1ab00a7e210 M builtin
> :100644 100644 d1b6646f42d5d12740a94f50a7d25aad4aa356bf
> b88343d977d78364b417e2015eaa352dec1501b9 M submodule.c
> :040000 040000 a3c58919de0796b6467709a0f21fa21e28d4d13b
> cdf9514c9085efcbfcdba8efc765174f6455ce5d M t
>
> Can you please suggest a fix? Is this the expected behavior?
>
> Thanks,
> - Orgad
ping
- Orgad
prev parent reply other threads:[~2019-06-10 13:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 9:14 Performance regression on git fetch in 2.21 Orgad Shaneh
2019-06-10 13:55 ` Orgad Shaneh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGHpTBLvVLY4YTp6c1x66WvO-OsqqTQ_-DAvBi20LFz-BG0+uA@mail.gmail.com \
--to=orgads@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).