Repository navigation
Restore previous errno after post command hook - #860
Merged
Johannes Schindelin (dscho) merged 1 commit intoFeb 10, 2026
Merged
Johannes Schindelin (dscho) merged 1 commit into
Johannes Schindelin (dscho) merged 1 commit into
Conversation
Derrick Stolee (derrickstolee)
previously approved these changes
Feb 10, 2026
Derrick Stolee (derrickstolee)
left a comment
There was a problem hiding this comment.
Thanks for finding and fixing this!
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/postcommand-fix-help
branch
from
February 10, 2026 18:27
b8706ed to
7c70515
Compare
Tyrie Vella (tyrielv)
dismissed
Derrick Stolee (derrickstolee)’s stale review
February 10, 2026 18:28
The base branch was changed.
Johannes Schindelin (dscho)
approved these changes
Feb 10, 2026
Johannes Schindelin (dscho)
enabled auto-merge
February 10, 2026 18:46
Derrick Stolee (derrickstolee)
approved these changes
Feb 10, 2026
Johannes Schindelin (dscho)
disabled auto-merge
February 10, 2026 20:45
Member
Johannes Schindelin (dscho)
merged commit Feb 10, 2026
1e32467
into
microsoft:vfs-2.53.0
1 check passed
Member
|
I had to elevate to admin to "bypass" the "missing" check prerequisite. |
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 12, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 17, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 17, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 20, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 20, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Apr 20, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Jun 12, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Jun 12, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Jun 17, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Sep 22, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
Johannes Schindelin (dscho)
added a commit
that referenced
this pull request
Oct 19, 2026
Test and fix for #859 : Repro steps: In a repository where post-command hook is configured (such as a VFSForGit clone) 1. Configure autocorrect: `git config help.autocorrect=prompt` 2. Run an misspelled command. For example, `git statuss` Expected output: ``` WARNING: You called a Git command named 'statuss', which does not exist. Run 'status' instead [y/N]? ``` Actual output: ``` failed to run command 'statuss': No error ``` I think the problem is that [run_post_command_hook](https://github.com/microsoft/git/blob/9db3c15f497c5d59a20bb2ff4d054ff687d08334/git.c#L503C1-L503C26) needs to save and restore errno, similar to how handle_alias does it. Otherwise, the errno from the failed command is overwritten by the successful errno from postcommand hook before the help autocorrect has a chance to examine it.
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
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.

Test and fix for #859