Skip to content
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

Add a flag to msync execute on the default branch #288

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

smortex
Copy link
Member

@smortex smortex commented Jun 21, 2024

From time to time, it makes sense to ensure we have a clean environment
to work on and synchronize the module repositories with what is
available on the remote end to do some local cleanup.

By default we work on what is configured in modulesync_config's default
branch (usualy a branch named "modulesync"), but for running git pull
we want to be on the default branch, which may be named 'main' or
'master' depending on the repository. Using --branch main or
--branch master will not have the expected outcome.

Add a --default-branch / -B flag to indicate that we want to work on
the default branch of the module.

This allows one to do some cleanup with:

bundle exec msync execute --default-branch -- git pull
bundle exec msync execute --default-branch -- git fetch --prune
bundle exec msync execute --default-branch -- git reset --hard

This is hopefully more convenient than removing the whole modules
directory and fetching all modules again.

From time to time, it makes sense to ensure we have a clean environment
to work on and synchronize the module repositories with what is
available on the remote end to do some local cleanup.

By default we work on what is configured in modulesync_config's default
branch (usualy a branch named "modulesync"), but for running `git pull`
we want to be on the default branch, which may be named 'main' or
'master' depending on the repository.  Using `--branch main` or
`--branch master` will not have the expected outcome.

Add a `--default-branch` / `-B` flag to indicate that we want to work on
the default branch of the module.

This allows one to do some cleanup with:

```
bundle exec msync execute --default-branch -- git pull
bundle exec msync execute --default-branch -- git fetch --prune
bundle exec msync execute --default-branch -- git reset --hard
```

This is hopefully more convenient than removing the whole `modules`
directory and fetching all modules again.
@ekohl ekohl merged commit 2d8a214 into master Jun 22, 2024
6 checks passed
@ekohl ekohl deleted the execute-on-default-branch branch June 22, 2024 12:41
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