Skip to content

Post commit hook traverses submodules, causing git commit to take an extremely long time to complete #3638

Closed

Description

@rcdailey

Maybe similar to #3490, but I opened a new issue since the root cause might be different.

Here is the command I run:

GIT_TRACE=1 git commit -a --amend --no-edit

The trace file is attached here: commit-trace.txt

My repository structure has 2 submodules in it. Here is my .gitmodules:

[submodule "zPayService/ZPayUtilities"]
    path = zPayService/ZPayUtilities
    url = ../zpay-utilities.git
[submodule "Core"]
    path = Core
    url = ../core.git
    branch = .

The Core submodule is also an LFS repository. The post-commit started going into the Core subdirectory, which it shouldn't do because that's a submodule. Evidence is shown in the attached trace, here's a small snippet:

12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/external/concurrent_queue"
12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/LICENSE_POWERVR_SDK.txt"
12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/include/CL"

Because the post commit hook is traversing the submodule files, it makes commits in the parent repository take a very long time. Is this a bug or a configuration issue?

Activity

  1. bk2204 commented on May 9, 2019

    @bk2204
    Member

    Hey, thanks for writing in.

    I don't think this is intentional; I think it's a bug in our repository walker, which doesn't ignore submodules as it should. I'll flag this as a bug, and hopefully we can get it fixed for v2.8.0.

  2. added this to the v2.8.0 milestone on May 9, 2019
  3. rcdailey commented on Jun 19, 2019

    @rcdailey
    Author

    @bk2204 I did a test using your commit you just made and it's significantly faster. Enabling GIT_TRACE=1 doesn't show any indication that my submodule was explicitly skipped. Is there any log in particular I should look for to verify that my submodule was skipped? I was looking for something like filepathfilter: rejecting referring to my submodule directory, but don't see it.

  4. bk2204 commented on Jun 19, 2019

    @bk2204
    Member

    Because we simply don't traverse into submodules now (instead of traversing and rejecting them with the filepathfilter), there won't be any specific output that indicates that we're ignoring them. However, you should be able to see an absence of any filepathfilter accepting lines referring to the submodule.

    In other words, lines like these should now be absent:

    12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/external/concurrent_queue"
    12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/LICENSE_POWERVR_SDK.txt"
    12:29:47.164317 trace git-lfs: filepathfilter: accepting "Core/External/PowerVR/source/include/CL"
    
  5. rcdailey commented on Jun 19, 2019

    @rcdailey
    Author

    Thanks for the quick response. I'm certainly not seeing those in there anymore. And also like I said, the speed is significantly improved. I wanted to give you that extra feedback that your solution worked. Thanks so much for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions