set the default remote to origin on addon install and when a module is getting added - #36
Closed
rpkoller wants to merge 3 commits into
Closed
set the default remote to origin on addon install and when a module is getting added#36rpkoller wants to merge 3 commits into
rpkoller wants to merge 3 commits into
Conversation
mstrelan
reviewed
Jul 29, 2026
mstrelan
reviewed
Jul 29, 2026
| # Create test output directory | ||
| - mkdir -p ../test_output | ||
| # Set checkout.defaultRemote to origin for Drupal core if not set yet | ||
| - if [ -z "$(git config --get checkout.defaultRemote)" ]; then git config set checkout.defaultRemote origin; echo "checkout.defaultRemote set to origin"; fi |
Contributor
There was a problem hiding this comment.
My only concern is if this means people might accidentally end up pushing to origin instead of a fork. Not sure how likely that is, and it would only be for those who have access.
Owner
|
Posted an alternative approach in #37, which doesn't modify the git config automatically. |
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.
The Issue
How This PR Solves The Issue
Within the install.yaml i've added an if statement that checks if
checkout.defaultRemoteis set for the Drupal core repo (most likely it is not). If that is the case it is setting it tooriginto provide a fully qualified name and to avoid any problems with the switch command after a MR was added and checked out. When the addon is getting uninstalled that setting for the Drupal core repo is getting unset again in case the value is set toorigin- but not completely certain about that step. in a previous iteration ive generally unset it on addon install now i changed it to only unset it in case the value isoriginfor the
add-modulei've added the same condition, in case no defaultRemote is set it is getting set toorigin. For theremove-moduleno unsetting is necessary cuz on module removal the repo is getting deleted.and i've added a small section at the end of the installation section within the readme to inform the user about the behavior under the hood setting checkout.defaultRemote to
originand provided the command necessary to adjust that default setting to their own likes.Manual Testing Instructions
Automated Testing Overview
Release/Deployment Notes