Skip to content

git commit take a long time #631

@LeoWu2024

Description

@LeoWu2024

Setup

  • Which version of microsoft/git are you using? Is it 32-bit or 64-bit?
    64
$ git --version --build-options

git version 2.43.0.vfs.0.0
cpu: x86_64
built from commit: b7a6ed788a205fb2c0013111d277b4c9d6ab35bd
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
 

Are you using Scalar or VFS for Git?

Scalar

If VFS for Git, then what version?

$ gvfs version

** insert your machine's response here **
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    10, 64 bit
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.4046]
(c) Microsoft Corporation. All rights reserved.

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I set the following variables to trace some debug info below, and found it tooks a long time to execute "git-lfs post-commit" during git commit.
$Env:GIT_TRACE=1
$Env:GIT_CURL_VERBOSE=1
$GIT_TRANSFER_TRACE=1
$GIT_TRACE2_PERF=1

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash, CMD, Powershell

Start GitOperation-AddnFile, DebugMode = True, LocalGitRepo = D:\WS\LRU
git : 18:39:03.623306 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
At line:1 char:1
+ git commit -m "Adding 10 new text files for $("feature-branch-$i")" * ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (18:39:03.623306...Git/mingw64/bin:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
18:39:03.653334 git.c:535               trace: built-in: git commit -m 'Adding 10 new text files for feature-branch-11'
18:39:04.263676 run-command.c:1523      run_processes_parallel: preparing to run up to 1 tasks
18:39:04.263676 run-command.c:659       trace: run_command: GIT_EDITOR=: GIT_INDEX_FILE=.git/index 
.git/hooks/post-commit
18:39:04.373853 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
18:39:04.383852 git.c:824               trace: exec: git-lfs post-commit
18:39:04.383852 run-command.c:659       trace: run_command: git-lfs post-commit
18:39:04.485020 trace git-lfs: exec: uname 
18:39:04.643717 trace git-lfs: exec: git 'version'
18:39:04.775980 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' 
'-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel'
18:39:04.864569 trace git-lfs: exec: git 'config' '--includes' '-l'
18:39:04.954251 trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
18:39:05.041826 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' ':.lfsconfig'
18:39:06.503523 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' 'HEAD:.lfsconfig'
18:39:06.616373 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' 
'-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
18:39:06.723490 trace git-lfs: NewLsFiles: running in D:\WS\LRU git ls-files -z --cached --sparse --exclude-standard 
--others
18:39:06.723490 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' 
'-c' 'filter.lfs.required=false' 'ls-files' '-z' '--cached' '--sparse' '--exclude-standard' '--others'
18:39:25.115942 trace git-lfs: findAttributeFiles: located .gitattributes
18:39:25.166066 run-command.c:1551      run_processes_parallel: done
[feature-branch-11 555d188804f] Adding 10 new text files for feature-branch-11
 10 files changed, 170660 insertions(+)
 create mode 100644 GitSample-1.txt
 create mode 100644 GitSample-10.txt
 create mode 100644 GitSample-2.txt
 create mode 100644 GitSample-3.txt
 create mode 100644 GitSample-4.txt
 create mode 100644 GitSample-5.txt
 create mode 100644 GitSample-6.txt
 create mode 100644 GitSample-7.txt
 create mode 100644 GitSample-8.txt
 create mode 100644 GitSample-9.txt
End GitOperation-AddnFile
  • What did you expect to occur after running these commands?

In normal they used to work much faster in several seconds. It just commit 10 * 50KB files.

  • What actually happened instead?

I need to wait 21 seconds for "git commit".

  • If the problem was occurring with a specific repository, can you specify
    the repository?

    • Public repo: insert URL here
    • Windows monorepo
    • [ X] Office monorepo
    • Other Microsoft-internal repo: insert name here
    • Other internal repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions