Commit Graph

1 Commits

Author SHA1 Message Date
Prasanna Kumar Kalever
b923f8c08f git-branch-diff: wrapper script for git to visualize backports
This script helps in visualizing backported and missed commits between two
different branches, tags or commit ranges. In the list of missed commits,
it will help you identify patches which are posted for reviews on gerrit server.

While backporting commit to another branch only subject of the patch may
remain unchanged, all others such as commit message,  commit Id, change Id,
bug Id, may be changed. This script works by taking commit subject as the
key value for comparing two git branches, which can be local or remote.

Help:
$ ./extras/git-branch-diff.py --help
    usage: git-branch-diff.py [-h] [-s SOURCE] -t TARGET [-a AUTHOR] [-p PATH]
                              [-o OPTIONS]

    git wrapper to diff local or remote branches/tags/commit-ranges

    optional arguments:
     -h, --help            show this help message and exit
     -s SOURCE, --source SOURCE
                           source pattern, it could be a branch, tag or a commit
                           range
     -t TARGET, --target TARGET
                           target pattern, it could be a branch, tag or a commit
                           range
     -a AUTHOR, --author AUTHOR
                           default: git config name/email, to provide multiple
                           specify comma separated values
     -p PATH, --path PATH  show source and target diff w.r.t given path, to
                           provide multiple specify space in between them
     -o OPTIONS, --options OPTIONS
                           add other git options such as --after=<>, --before=<>
                           etc. experts use;

Sample usages:
  $ ./extras/git-branch-diff.py -t origin/release-3.8
  $ ./extras/git-branch-diff.py -s local_branch -t origin/release-3.7
  $ ./extras/git-branch-diff.py -s 4517bf8..e66add8 -t origin/release-3.7
  $ ./extras/git-branch-diff.py -s HEAD..c4efd39 -t origin/release-3.7
  $ ./extras/git-branch-diff.py -t v3.7.11 --author="author@redhat.com"
  $ ./extras/git-branch-diff.py -t v3.7.11 --author="authorX, authorY, authorZ"
  $ ./extras/git-branch-diff.py -t origin/release-3.8 --path="xlators/"
  $ ./extras/git-branch-diff.py -t origin/release-3.8 --path="./xlators ./rpc"
  $ ./extras/git-branch-diff.py -t origin/release-3.6 --author="*"
  $ ./extras/git-branch-diff.py -t origin/release-3.6 --author="All"
  $ ./extras/git-branch-diff.py -t origin/release-3.6 --author="Null"
  $ ./extras/git-branch-diff.py -t v3.7.11 --options "--after=2015-03-01 \
                                                      --before=2016-01-30"

Example output:
$ ./extras/git-branch-diff.py -t origin/release-3.8 --path="./rpc"

------------------------------------------------------------

[ ✔ ] Successfully Backported changes:
      {from: remotes/origin/master  to: origin/release-3.8}

[84e90b7] server/protocol: option for dynamic authorization of client permissions
[5bf6522] rpc: By default set allow-insecure, bind-insecure to on
[3af9b53] glusterd: try to connect on GF_PMAP_PORT_FOREIGN aswell
[9442e7b] rpc: fix binding brick issue while bind-insecure is enabled
[7370633] rpc: assign port only if it is unreserved
[88a386b] rpc: fix gf_process_reserved_ports

------------------------------------------------------------

[ ✖ ] Missing patches in origin/release-3.8:

All keys already loaded
[50ca123] rpc: define client port range (under review)
[89759de] glusterd: add defence mechanism to avoid brick port clashes (under review)

------------------------------------------------------------

Note: This script may ignore commits which have altered their commit subjects
while backporting patches. Also this script doesn't have any intelligence to
detect squashed commits.

Change-Id: Ieb27e548c1945a208e2f5d390c99cac82d18a665
BUG: 1336642
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Reviewed-on: http://review.gluster.org/14230
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
2016-05-18 10:11:03 -07:00