forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
t/t5571-prep-push-hook.sh: Add test with writing to stderr #6063
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
Merged
dscho
merged 1 commit into
git-for-windows:main
from
t-b:add-pre-push-hook-stderr-regression-test
Jan 27, 2026
Merged
t/t5571-prep-push-hook.sh: Add test with writing to stderr #6063
dscho
merged 1 commit into
git-for-windows:main
from
t-b:add-pre-push-hook-stderr-regression-test
Jan 27, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The 2.53.0.rc0.windows release candidate had a regression where writing to stderr from a pre-push hook would error out. The regression was fixed in 2.53.0.rc1.windows and the test here ensures that this stays fixed. Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
1 task
Member
|
I investigated a bit more whether I could pinpoint an exact upstream commit that would be responsible for this, but could not quite figure it out. I left the conclusions of my analysis in the description of this PR, which will become the merge commit message. |
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
dscho
added a commit
that referenced
this pull request
Jan 27, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 28, 2026
…indows#6063) Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes git-for-windows#6053.
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 28, 2026
…indows#6063) Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes git-for-windows#6053.
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 28, 2026
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a `pre-push` hook remains unbroken. The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the `git push` fails, with this message printed to standard error: .git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940] error: failed to push some refs to 'repo1' When that hook runs, `/dev/stderr` is a symlink to `/proc/self/fd/2`, as always, but `ls -l /proc/self/fd/` shows this in the failing run total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0] lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0] instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1): total 0 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]' lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1 lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual' This suggests that the underlying reason might be that `stdout` has an exclusive handle to that pipe, and opening `stderr` (which points to the same pipe) fails because of that exclusively-opened `stdout` handle. This closes #6053.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Git v2.53.0-rc0 included f406b89 (Merge branch 'ar/run-command-hook', 2026-01-06), which caused a regression on Windows. While this merge was reverted for independent reasons in a3d1f39 (Revert "Merge branch 'ar/run-command-hook'", 2026-01-15), it seems worthwhile to ensure that writing to standard error from a
pre-pushhook remains unbroken.The symptom, when running this regression test case against v2.53.0-rc0.windows.1 is that the
git pushfails, with this message printed to standard error:.git/hooks/pre-push: line 2: /dev/stderr: No such file or direct[61/1940]
error: failed to push some refs to 'repo1'
When that hook runs,
/dev/stderris a symlink to/proc/self/fd/2, as always, butls -l /proc/self/fd/shows this in the failing runtotal 0
lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 0 -> pipe:[0]
lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 1 -> pipe:[0]
lrwxrwxrwx 1 me 4096 0 Jan 27 14:34 2 -> pipe:[0]
instead of the expected contents (which are shown when running this against v2.53.0-rc1.windows.1):
total 0
lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 0 -> 'pipe:[0]'
lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 1 -> /dev/cons1
lrwxrwxrwx 1 me 4096 0 Jan 27 14:53 2 -> '/path/to/git/t/trash directory.t5571-pre-push-hook/actual'
This suggests that the underlying reason might be that
stdouthas an exclusive handle to that pipe, and openingstderr(which points to the same pipe) fails because of that exclusively-openedstdouthandle.This closes #6053.