[Gluster-devel] git-branch-diff: wrapper script for git to visualize backports

Niels de Vos ndevos at redhat.com
Mon May 9 12:07:51 UTC 2016


On Thu, May 05, 2016 at 11:25:35PM +0530, Prasanna Kalever wrote:
> Hi Team,
> 
> Checkout glusterfs script that is capable of showing your list of commits
> missed (backporting) in other branches (say 3.7.12) w.r.t master
> 
> http://review.gluster.org/#/c/14230/
> 
> 
> This script helps in visualizing backported and missed commits between two
> different branches.

That can be pretty helpful, at least as long as the stable branch(es) do
not diverge too much. Which, will hopefully happen quickly... We really
should not backport much to stable branches.

> 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, will be changed. This script works by taking commit subject as the
> key value for comparing two git branches, which can be local or remote.

Actually, it is strongly recommended to keep the Change-Id the same for
backports. Unfortunately only very few developers stick to our
guidelines for backports, and the Change-Id gets modified :-/

It would be the most suitable way of checking for (missing) backports.

> Help:
> 
> $ ./extras/git-branch-diff.py --help
>     usage: git-branch-diff.py [-h] [-s SOURCE_BRANCH] -t TARGET_BRANCH
>                               [-a GIT_AUTHOR] [-p REPO_PATH]
> 
>     git wrapper to diff local/remote branches
> 
>     optional arguments:
>       -h, --help            show this help message and exit
>       -s SOURCE_BRANCH, --source-branch SOURCE_BRANCH
>                             source branch name
>       -t TARGET_BRANCH, --target-branch TARGET_BRANCH
>                             target branch name
>       -a GIT_AUTHOR, --author GIT_AUTHOR
>                             default: git config name/email
>       -p REPO_PATH, --path REPO_PATH
>                             show branches diff specific to path
> 
> 
> 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 -t origin/release-3.8
> --author="user2 at redhat.com"
>   $ ./extras/git-branch-diff.py -t origin/release-3.8 --path="xlators/"
> 
>   $ ./extras/git-branch-diff.py -t origin/release-3.8 --author=""
> 
> 
> 
> 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}
> 
> glusterd: try to connect on GF_PMAP_PORT_FOREIGN aswell
> rpc: fix gf_process_reserved_ports
> rpc: assign port only if it is unreserved
> server/protocol: option for dynamic authorization of client permissions
> rpc: fix binding brick issue while bind-insecure is enabled
> rpc: By default set allow-insecure, bind-insecure to on
> 
> ------------------------------------------------------------
> 
> [ ✖ ] Missing patches in origin/release-3.8:
> 
> glusterd: add defence mechanism to avoid brick port clashes
> rpc: define client port range
> 
> ------------------------------------------------------------
> 
> 
> 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.

I guess checking the subject of a patch is sufficient for many changes.
More intelligence would be nice, but I doubt it is worth the effort.

Thanks,
Niels


> 
> 
> 
> Thanks,
> --
> Prasanna
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160509/68dd5cb0/attachment.sig>


More information about the Gluster-devel mailing list