-
Notifications
You must be signed in to change notification settings - Fork 499
fix(civisibility): Use -c flag for git safe.directory instead of modifying global config #4344
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
Conversation
…appended to the global configuration
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 496930f949
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
Benchmarks |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
dario.castane@datadoghq.com cancelled this merge request build |
|
/remove |
|
View all feedbacks in Devflow UI.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
Tests failed on this commit a6cf2d0: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit f225a88: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What does this PR do?
-c safe.directory=<path>flaggetSafeDirectoryConfig()function that caches the repository root path (viasync.Once)execGit()andexecGitStringWithInput()to automatically include the safe.directory configgetLocalGitData()that was adding entries to global git configMotivation
The previous approach modified the global git config by running:
This caused several problems:
--addcreates duplicate entries on repeated runsInstead of modifying global config, we now pass
safe.directoryas a command-line config override:Benefits:
sync.Oncefor performancePort of DataDog/ddtest#29
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!