-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stop printing pointless git
default branch warning into logs/tests
#8632
Merged
jakecoffman
merged 2 commits into
dependabot:main
from
jeffwidman:stop-printing-pointless-git-warning-into-logs-and-tests
Dec 19, 2023
Merged
Stop printing pointless git
default branch warning into logs/tests
#8632
jakecoffman
merged 2 commits into
dependabot:main
from
jeffwidman:stop-printing-pointless-git-warning-into-logs-and-tests
Dec 19, 2023
Conversation
This file contains 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
jeffwidman
commented
Dec 16, 2023
While running the `go_modules` tests, I noticed that the `git` warning about an unspecified default branch was being repeatedly thrown in tests. Originally I assumed it was a bad test fixture setup, but I tracked it down to here... so it may be filling production logs in addition to CI logs. Before adding this line: ``` [dependabot-core-dev] ~/go_modules $ rspec ./spec/dependabot/go_modules/file_updater_spec.rb Randomized with seed 30583 ...................hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> .hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> .hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> .hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> .hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> . Finished in 21.32 seconds (files took 2.56 seconds to load) 24 examples, 0 failures Randomized with seed 30583 ``` After adding this: ``` [dependabot-core-dev] ~/go_modules $ rspec ./spec/dependabot/go_modules/file_updater_spec.rb Randomized with seed 51472 ........................ Finished in 22.24 seconds (files took 3.53 seconds to load) 24 examples, 0 failures Randomized with seed 51472 ```
jeffwidman
force-pushed
the
stop-printing-pointless-git-warning-into-logs-and-tests
branch
from
December 18, 2023 22:37
25ec5e7
to
47bab6c
Compare
jakecoffman
approved these changes
Dec 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jeff!
jeffwidman
deleted the
stop-printing-pointless-git-warning-into-logs-and-tests
branch
December 19, 2023 20:49
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.
While running the
go_modules
tests, I noticed that thegit
warning about an unspecified default branch was being repeatedly thrown in tests.Originally I assumed it was a bad test fixture setup (similar to @deivid-rodriguez 's fixes in #8100 / #8113), but I tracked it down to here which appears to run in production... so it may be filling production logs in addition to CI logs.
Before adding this line:
After adding this: