introduce `commit_in_branch.py` script to help devs figure this out
authorEric Engestrom <eric@engestrom.ch>
Tue, 2 Jun 2020 22:22:33 +0000 (00:22 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Jul 2020 20:01:32 +0000 (20:01 +0000)
commit7f61f4180b645527d4c82404b18712946e77e551
tree43333f4c96d7db2f08b043bf2ff58d3ef31bc23c
parent40a6de176d0f4ffa9fcad8f2c8ab30a7e8cfe807
introduce `commit_in_branch.py` script to help devs figure this out

It's been pointed out to me that determining whether a commit is present
in a stable branch is non-trivial (cherry-picks are a pain to search for)
and the commands are hard to remember, making it too much to ask.

This script aims to solve that problem; at its simplest form, it only
takes a commit and a branch and tells the user whether that commit
predates the branch, was cherry-picked to it, or is not present in any
form in the branch.

    $ bin/commit_in_branch.py e58a10af640ba58b6001f5c5ad750b782547da76 fdo/20.1
    Commit e58a10af640ba58b6001f5c5ad750b782547da76 is in branch 20.1
    $ echo $?
    0

    $ bin/commit_in_branch.py dd2bd68fa69124c86cd008b256d06f44fab8e6cd fdo/20.1
    Commit dd2bd68fa69124c86cd008b256d06f44fab8e6cd was backported to branch 20.1 as commit d043d24654c851f0be57dbbf48274b5373dea42b
    $ echo $?
    0

    $ bin/commit_in_branch.py master fdo/20.1
    Commit 2fbcfe170bf50fcbcd2fc70a564a4d69096d968c is NOT in branch 20.1
    $ echo $?
    1

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5306>
bin/commit_in_branch.py [new file with mode: 0755]
bin/commit_in_branch_test.py [new file with mode: 0644]