Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

would like grr to be able to import a CR to the working copy #4

Open
trentm opened this issue Nov 16, 2017 · 0 comments
Open

would like grr to be able to import a CR to the working copy #4

trentm opened this issue Nov 16, 2017 · 0 comments

Comments

@trentm
Copy link
Contributor

trentm commented Nov 16, 2017

Somewhat the equivalent of this:

function cr-checkout {
    local crnum=$1
    if [[ -z "$crnum" ]]; then
        echo "cr-checkout: error: missing CRNUM argument" >&2
        echo "usage: cr-checkout CRNUM" >&2
        return 1
    fi
    patchset=$(git ls-remote cr | grep "refs/changes/../${crnum}/" | cut -d/ -f5 | sort -n | tail -1)
    git fetch -f cr refs/changes/${crnum:(-2)}/${crnum}/${patchset}:cr-${crnum}-${patchset}
    git checkout cr-${crnum}-${patchset}
}

You'd grr FULL-CR.JOYENT-US-URL and that would setup on a working feature branch with the latest patchset... inferring the issue from the current commit message. It should also be updatable if re-run after a new patchset was pushed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant