Skip to content

Conversation

@mjcheetham
Copy link
Contributor

Suppress the standard error stream from Git when checking if we're inside a repository or not, because the failure message is otherwise printed to the user's console when we are not (which is what we're trying to decide!).

Note that we normally don't suppress or redirect the standard error stream for Git commands as the user may have enabled Git tracing (v1 or v2) to the stderr file and we don't want to mute these for all calls.

Example before:

% pwd
/Users/mjcheetham
% gcm azure-repos list
fatal: not a git repository (or any of the parent directories): .git
devdiv:
  (global) -> USER@DOMAIN

Example now:

% pwd
/Users/mjcheetham
% gcm azure-repos list
devdiv:
  (global) -> USER@DOMAIN

Suppress the standard error stream from Git when checking if we're
inside a repository or not, because the failure message is otherwise
printed to the user's console when we are not (which is what we're
trying to decide!).

Note that we normally don't suppress or redirect the standard error
stream for Git commands as the user may have enabled Git tracing (v1 or
v2) to the stderr file and we don't want to mute these for all calls.
Copy link
Contributor

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@dscho dscho merged commit 1ed7037 into git-ecosystem:main Apr 16, 2024
@mjcheetham mjcheetham deleted the fix-notinrepo branch April 16, 2024 14:58
mjcheetham added a commit that referenced this pull request Apr 16, 2024
**Changes:**

- Fixes to install from source script (#1469)
- Use Avalonia generated view code (#14790
- Various GitHub Actions updates (#1473, #1483, #1487, #1486, #1488,
#1528, #1547)
- Fix bug in Azure Repos URL handling (#1522)
- Add Azure Managed Identity and SP docs (#1548)
- Fix error messages when using GCM outside of repo (#1561, #1583)
- Remove ESRP (#1571)
- Update to .NET 8 for Mac and Linux (#1579, #1580)
- Fix Alpine install from source script (#1582)
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

Successfully merging this pull request may close these issues.

2 participants