Crate git_sync

Source
Expand description

Manage Github repositories from the command line. You can perform an action on one repository, or on all repositories that are configured in the configuration file.

This tool is still in development so some features may not work as expected

You can do the following:

  1. Sync a forked repository with its upstream parent repository.
  2. Sync tags from its parent repository
  3. Manage branches (create, delete)
  4. Manage tags (create, delete)
  5. Create releases with automatically generated release notes
  6. Create and merge pull requests
  7. Run various sanity checks on repositories
  8. Create a PR and automatically merge it, if possible
  9. Backup a repository, including to S3 if enabled at build time
  10. Send notifications to slack if the slack feature is enabled
  11. Do all of the above for a single repository, or for all configured repositories

Some examples of how to use this tool:

git_sync tag create --tag v1.0.2 --branch my_dev_branch --repo https://github.com/org/my_repository
git_sync tag create --tag v1.0.0 --branch my_common_dev_branch --all --slack # will use all repos in your config file and enable slack notifications

When running a command with –all, you can specify which category of repositories to run the command on by specifying the --repository argument (valid options are ‘fork’, ‘private’, ‘public’, or ‘all’).

You can generate manpages and shell completions using the generate command:

git_sync generate --kind man
git_sync generate --kind bash # or fish, or zsh

When building this tool, you should use

cargo auditable build --release

cargo-auditable and cargo-audit can be installed by running

cargo install cargo-audit cargo-auditable

This way the binary will be built with information about the build dependencies embedded into the binary so that it can be scanned with tools like cargo-audit or Trivy.

Modules§

cli 🔒
config 🔒
error 🔒
github 🔒
init 🔒
slack 🔒
utils 🔒

Macros§

async_retry
A macro to easily retry asynchronous operations with exponential backoff and optional error filtering.
handle_api_response
Handles the result of an API call using octocrab and maps them to a GitError. This helps reduce a lot of unnecessary boilerplate. This is used for api calls that don’t already have a high level function provided by Octocrab.
handle_futures_unordered
Handles reducing some of the boiler plate for defining these unordered futures.

Functions§

main 🔒