Skip to main content

A command line utility to list and merge GitHub pull requests while maintaining linear history

Project description

git-pr-linear-merge

A command line utility to list and merge GitHub pull requests while maintaining linear history.

To maintain linear history, a pull request branch is rebased on top of its base, before merging. This creates a linear history like in this diagram:

linear_history

Further Reading & Context

Usage

Installing

Python3.6 or above is required. You can install this package by running the following command:

pip install git-pr-linear-merge

How To Use

git pr -h
git pr list
git pr merge NUMBER

The first time you run this, you will be asked to authenticate with Github.

Development

This section explains how to setup the dev environment and update the package

Environment setup

python3 -m pip install virtualenv
python3 virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Running Locally

With the environment setup through the previous step, you can run git pr using your local code by running the git-pr.py script in the root directory of this repo.

python git-pr.py

Updating the package

Make sure to bump the version number with updates according to PEP 440

Test Publish

source venv/bin/activate
rm -rf dist
rm -rf build
python -m build
twine upload --repository testpypi dist/*

Publish

source venv/bin/activate
rm -rf dist
rm -rf build
python -m build
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-pr-linear-merge-1.0.0a1.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

git_pr_linear_merge-1.0.0a1-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page