Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirecting stdout causes the program to stop for 40 seconds #590

Open
2 tasks done
miku1958 opened this issue Jul 14, 2023 · 1 comment
Open
2 tasks done

Redirecting stdout causes the program to stop for 40 seconds #590

miku1958 opened this issue Jul 14, 2023 · 1 comment

Comments

@miku1958
Copy link

miku1958 commented Jul 14, 2023

Setup

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

git version 2.40.1.vfs.0.2
cpu: x86_64
built from commit: 59bc9667c84164a4ad879d9b424687ca631f01b3
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Are you using Scalar or VFS for Git?

Scalar

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
macOS 13.4.1

Details

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

bash

#!/bin/bash
start=$(date +%s)

output=$(/usr/local/bin/git checkout 2>&1)

end=$(date +%s)

diff=$((end - start))
echo "git $@ | cost: $diff s"
  • What did you expect to occur after running these commands?

It completes just as quickly as running git checkout directly

  • What actually happened instead?

when I use /usr/local/bin/git checkout in the script, it takes 6 s, but when I try to save the output to a variable, it takes 45 s

I also change /usr/local/bin/git to /usr/bin/git to save the output, and Apple-git finish it immediately.

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

    • Office monorepo
@dscho
Copy link
Member

dscho commented Aug 14, 2023

Is this really reproducible? I would expect the git checkout to be relatively slow when e.g. FSMonitor just started up, but to be fast otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants