Giter Site home page Giter Site logo

joscollin / downstream-cherry-picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from red-hat-storage/downstream-cherry-picker

0.0 1.0 0.0 52 KB

cherry-pick GitHub PRs that correspond to Red Hat Bugzilla bugs

License: MIT License

Python 95.90% Shell 4.10%

downstream-cherry-picker's Introduction

downstream-cherry-picker

https://travis-ci.org/red-hat-storage/downstream-cherry-picker.svg?branch=master

A tool to quickly cherry-pick whole GitHub pull requests that correspond to Red Hat Bugzilla bugs.

This is tool is suitable for cherry-picking upstream patches into downstream -patches branches for rdopkg to consume.

Example:

(Let's say you've cloned to ceph here):
$ cd dev/ceph

(And you have the "patches" remote set up like so):
$ git remote -v
  patches ssh://[email protected]/ceph (fetch)
  patches ssh://[email protected]/ceph (push)

(Reset your local branch to the latest "-patches"):
$ git checkout ceph-1.3-rhel-patches
$ git fetch patches
$ git reset --hard patches/ceph-1.3-rhel-patches

$ downstream-cherry-picker https://github.com/ceph/ceph/pull/10699 1335564
...

$ git log
(shows the new cherry-pick for that PR/bug.)

Installing:

The easiest way to get downstream-cherry-picker is use ktdreyer/downstream-cherry-picker copr on Fedora or el7:

dnf copr enable ktdreyer/downstream-cherry-picker

After you've enabled the repo, install the package:

dnf -y install downstream-cherry-picker

Or, if you want to hack on the code, install it in a Python virtualenv directly from GitHub:

virtualenv venv
. venv/bin/activate
git clone https://github.com/red-hat-storage/downstream-cherry-picker
python setup.py develop

You will now have a downstream-cherry-picker utility in your $PATH.

Features:

  • Uses GitHub's API to determine the range of commits to cherry-pick for a particular pull request.
  • Cherry-picks each commit in a PR using standard conventions:
    • Adds "(cherry-picked from commit foo)" to each cherry-pick.
    • Adds "Resolves: rhbz#" to each cherry-pick.
  • Does all the work on a separate "rhbz-" Git branch, so you can clean up if things go wrong or you have to resolve conflicts by hand. This branch name convention will trigger the Git commit hook that inserts the rhbz number into each changelog. If you do not have the Git commit hook installed into your repository, downstream-cherry-picker will download and install it for you.
  • If everything cherry-picked cleanly, downstream-cherry-picker will merge the temporary rhbz- branch back into your original branch and delete the rhbz- branch, so that you're all ready to push your changes to the remote.
  • Automatically fetches the pull request's commits if you don't have the commits in your local clone already.

Common Errors:

error: a cherry-pick or revert is already in progress

  • This may have been a leftover from trying to cherry-pick previously. Abort the current cherry-pick, delete the old temp branch, and re-try:

    git chery-pick --abort
    git checkout ceph-2-rhel-patches
    git branch -D rhbz-1333809
    downstream-cherry-picker https://github.com/ceph/ceph/pull/13108 1333809
    

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.