Giter Site home page Giter Site logo

mainer's Introduction

mainer

Mainer helps GitHub repo users switch "master" branches to "main".

Branch renaming is the easy part. But you may be left with hundreds or thousands of links to "master" in GitHub issue and PR comments. This is where mainer comes in.

Mainer uses the GitHub API to find issues, PRs, and comments which have text linking to the master branch of a repo (the same or another) and rewrites that text to link to the main branch instead.

Note well: this is pre-release software. Do use mainer's --dry-run mode first to see what would happen in a real, text-altering use of the program.

Installation

python -m pip install --pre mainer

Usage

$ python -m mainer --help
Usage: mainer.py [OPTIONS] ORG/REPO

  Rewrite links in a repo's issue and PR comments so that they point to the
  linked repo's main branch instead of its master branch.

  Example:

  python -m mainer org1/repo1 --rewrite-links-to org2/repo2 --dry-run

Options:
  --dry-run                Print comment diffs to stderr, but make no edits.
  --rewrite-links-to TEXT  The repo named in the links to be fixed. For
                           example: 'org2/repo2'. Defaults to ORG/REPO.

  --access-token TEXT      A GitHub access token. May also be set by
                           GITHUB_ACCESS_TOKEN or GithubAccessToken in the
                           environment.

  --help                   Show this message and exit.

Dry run mode

With the --dry-run option, mainer prints diffs representing the changes it would make to comments of the target repo.

Editing mode

Attention: without the --dry-run option, mainer will edit comments without confirmation prompts or backups (like, for example sed -i).

mainer's People

Contributors

sgillies avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mainer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.